• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB 3 TransactionTimeout annotation needed

 
Greenhorn
Posts: 25
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using BMT you can use getEntityContext().getUserTransaction().setTransactionTimeout(int seconds);
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic