Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction EJB  RSS feed

 
Vinod Kumar
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
 
Pradeep bhatt
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!