This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set the tx attribute of method requires new.
 
Beware the other head of science - it bites! Nibble on this message:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!