Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Transaction EJB  RSS feed

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have three methods in my Stateless EJB
public A()
private B()
public C()
method A() calls method B()
method B() calls method C()
method B does a database insertion using a JDBC connection.
after this operation JDBC connection is closed and C() is called.
method C does a JMS publishing,but it is not able to get the connection to publish the topic and waits for a long time
method A is getting a TransactionRolledBack exception because of time out from C()
I need to commit the database transaction in B() and ignore the time out of method C() basically catch some exception or to set the transaction attributes to the method so that the caller method A() is not worried about this JMS issue in C().

All methods are having transaction attribute as TX_REQUIRED and isolation level as TRANSACTION_READ_COMMITED.
How to handle this situation.
Thanks in Advance,
Vinod
 
Ranch Hand
Posts: 8934
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set the tx attribute of method requires new.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!