Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handling transaction time out

 
sanjiv kapila
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do we have any other option other than spawning thread.
As indicated by you. the thread handling itself is a bit headache.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic