• 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

Transaction EJB

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Set the tx attribute of method requires new.
 
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic