I have a module which operates on thousands of transactions to process . Each transaction has multiple phases to go through. This module executes in multithreaded mode. We have defined limits (hardcoded)for number of threads it can create (limited as per server utilization ).
now we came accross a situation, where threads may need to wait for some period (may be more than 24 hours). As we have limited number of threads and if all threads are waiting for more than 24 hours, this is entirely blocking the application.
What i need here is, how should i reuse the thread which is under wait wait for 24 hour. if thread is going in wait mode, i need to reuse that thread for anather transaction and when original wait ends, restart the original transaction from where it was put on hold.
i hope above discription helps u to understand issue.