File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB 3 TransactionTimeout annotation needed

 
Saurabh Gokhale
Greenhorn
Posts: 25
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 98
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using BMT you can use getEntityContext().getUserTransaction().setTransactionTimeout(int seconds);
 
Sebastien Joly
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have exactly the same problem with a CMT.

Did you find any solution, I'm stuck.

Thanks
 
Sebastien Joly
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic