File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Handling transaction time out" Watch "Handling transaction time out" New topic
Author

Handling transaction time out

sanjiv kapila
Greenhorn

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
Greenhorn

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
Greenhorn

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.
 
jQuery in Action, 2nd edition
 
subject: Handling transaction time out
 
Similar Threads
Threads in Tomcat
External JMS System access
back up software?
Method trigger automatically after some time
Handling timeout in java