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 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
Author

EJB 3 TransactionTimeout annotation needed

Saurabh Gokhale
Greenhorn

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
Greenhorn

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

Did you find any solution, I'm stuck.

Thanks
Sebastien Joly
Greenhorn

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="http://www.bea.com/ns/weblogic/90"
xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
<weblogic-enterprise-bean>
<ejb-name>AdministrationDiffusionServiceImpl</ejb-name>
<transaction-descriptor>
<trans-timeout-seconds>1200</trans-timeout-seconds>
</transaction-descriptor>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 3 TransactionTimeout annotation needed
 
Similar Threads
how can I specify EJB timeout?
Need allow-concurrent-access anotation / DD entry for weblogic 10
Setting the Transaction Time
JTA Transaction time out Vs EJB Timeout
Database timeout settings