This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Transaction Timed Out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Transaction Timed Out" Watch "Transaction Timed Out" New topic

Transaction Timed Out

Jeff Storey
Ranch Hand

Joined: Oct 09, 2006
Posts: 118
I have a long running method that runs from within a stateful bean (JBoss 4 is my app server). I have not configured any specific transaction setup, but for some reason, when this long method runs, a transaction timed out message is printed during the middle of it (and it does not run to completion). This method does not update a DB, so I'm not sure what makes it a transaction. Is there something specific I need to do to tell this method NOT to run as a transaction? Or is there some other reason this might be happening? Thank you.

Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
If you don't want a method of the bean to be part-of/start transaction you need to specify "trans-attribute" as NotSupported in the ejb-jar.xml. In JBOSS and with most App server if you don't specify this attribute the default will be Required. Are your getting time out exception after 5 mins? Just to know the default setup.
Jeff Storey
Ranch Hand

Joined: Oct 09, 2006
Posts: 118
Thanks, unfortunately thought I do not have an ejb-jar.xml (I don't think) since I am using EJB 3 annotations rather than this config file. Is there an annotation to do this? Also, as for timing out after 5 minutes, that seems like about right, I haven't timed it exactly.
I agree. Here's the link:
subject: Transaction Timed Out
It's not a secret anymore!