I have a method calling external interface interaction. MY transaction start before invoking this transaction. However this external interface amy take long or even go in infinite wait state at times and thereby causing my transaction to go incomplete. I have set the transaction time out for this transaction. But am unable to get control of application due to no-response from External interface. Do i have any chance of getting the control back to my program even if external interface does not respond infinitely.
You can have a thread which calls the external interface and goes to sleep for a specific amount of time. If the external interface responds within that time frame, you will proceed with your normal flow. Otherwise, throw an exception indicating the problem. But I dont know what kind of application yours is. Please note that this approach is preferrable only for stand alone applications. In servlets/EJBs, writing your own thread involves lots of headaches.
Joined: Mar 14, 2005
Do we have any other option other than spawning thread. As indicated by you. the thread handling itself is a bit headache.