File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Handling transaction time out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Handling transaction time out" Watch "Handling transaction time out" New topic

Handling transaction time out

sanjiv kapila

Joined: Mar 14, 2005
Posts: 3
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.
Phani Kumar

Joined: Feb 15, 2002
Posts: 22
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.
sanjiv kapila

Joined: Mar 14, 2005
Posts: 3
Do we have any other option other than spawning thread.
As indicated by you. the thread handling itself is a bit headache.
I agree. Here's the link:
subject: Handling transaction time out
It's not a secret anymore!