*
The moose likes BEA/Weblogic and the fly likes How to catch EJB Transaction Timeout? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "How to catch EJB Transaction Timeout?" Watch "How to catch EJB Transaction Timeout?" New topic
Author

How to catch EJB Transaction Timeout?

Alan A Smith
Greenhorn

Joined: Apr 25, 2003
Posts: 21
Hi,
is the following true as regards to transaction timeouts.
The descriptor is set as:

<transaction-descriptor>
<trans-timeout-seconds>2</trans-timeout-seconds>
</transaction-descriptor>

The actual transaction takes 3 seconds but it does not really time out after 2
seconds. The ejb container compares the actual time take (3 seconds in this case) with the set time (2 seconds) and then throws the TransactionTimeoutException.

Can I catch the TransactionTimeoutException after 2 seconds?
Thx.
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
I doubt you'll ever hit exactly, but how far off you are will depend on the reason for the timeout. If the timeout is due to some kind of blocking I/O (which you aren't supposed to do inside an EJB, but could still be an issue for a container service implementation used by the EJB), then you might not see the transaction failure until the block ends. I've definitely found that to be true for Weblogic.

Transaction timeouts unfortunately don't provide soft realtime-like guarantees, they just do the best they can. Sometimes you are better off moving some code interaction to JMS/MDB or JCA or JMX, depending on the problem, to improve your control over timing.


Reid - SCJP2 (April 2002)
ankush purwar
Ranch Hand

Joined: Sep 02, 2005
Posts: 46
You can't catch Transactiotimeoutexception in weblogic.
It's better for you to catch Remote Exception on client side not in sesion beans .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to catch EJB Transaction Timeout?
 
Similar Threads
how can I specify EJB timeout?
Timeouts in ejb
Timeoutexception
Urgent - Implementing correct time-outs
*URGENT* Boundary of trans-timeout-seconds