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 EJB 3 TransactionTimeout annotation needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3 TransactionTimeout annotation needed" Watch "EJB 3 TransactionTimeout annotation needed" New topic

EJB 3 TransactionTimeout annotation needed

Saurabh Gokhale

Joined: Dec 07, 2008
Posts: 25
I have EJB 3 Stateful session bean in the application. (weblogic 10.3 application server and jdk 1.6_05)
This EJB is in a complicated transaction which executes for more than 30 seconds (default transaction timeout value for EJB)

I need an annotation example (as I dont have any weblogic-ejb-jar.xml file) where I can set my own transaction timeout value for this EJB.

I found one weblogic annotation (Since this property is server specific) @weblogic.javaee.TransactionTimeoutSeconds.

But I am not able to find an example for this annotation anywhere and weblogic document does not specify how to use this annotation.

Can someone please help.

Also if there is no annotation, then can I just have weblogic-ejb-jar.xml without ejb-jar.xml? (as all my ejb-jar.xml entries are added to EJB in the form of annotation therefore I do not have any DD)
Damodar Mukhopadhyay
Ranch Hand

Joined: Jan 15, 2007
Posts: 98
If you are using BMT you can use getEntityContext().getUserTransaction().setTransactionTimeout(int seconds);

SCJP 1.5, SCWCD 1.4, SCBCD 5.0, next SCDJWS...
Sebastien Joly

Joined: Jan 05, 2011
Posts: 4
I have exactly the same problem with a CMT.

Did you find any solution, I'm stuck.

Sebastien Joly

Joined: Jan 05, 2011
Posts: 4
Solved :

I couldn't find any annotation that works with Weblogic 10.3 but I did solve this issue by adding a weblogic-ejb-jar.xml file :

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-ejb-jar xmlns=""
I agree. Here's the link:
subject: EJB 3 TransactionTimeout annotation needed
It's not a secret anymore!