Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction Rollback problem

 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am getting transaction roll back exception, while trying to call a session bean method with RequiresNew transaction attribute from onMessage of MDB. Any help to resolve this will be appreciated. I am using WAS 6.1.

Code structure:

MyMDBean - CMP, Required
MySessionBean - CMP, RequiresNew (all methods)

MyMDB.onMessage invokes the method processMessage on the MySessionBean. During this call it fails with the below exception. Please note, this error is not consistent, this is happening intermittently. Sometimes the messages gets processed properly, meaning the Session Bean method is invoked and process continues normally.

javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com.ibm.websphere.csi.CSITransactionRolledbackException: Transaction marked rollbackon
ly
com.ibm.websphere.csi.CSITransactionRolledbackException: Transaction marked rollbackonly
at com.ibm.ejs.csi.TranStrategy.postInvoke(TranStrategy.java:200)
at com.ibm.ejs.csi.RequiresNew.postInvoke(RequiresNew.java:93)
at com.ibm.ejs.csi.TransactionControlImpl.postInvoke(TransactionControlImpl.java:581)
at com.ibm.ejs.container.EJSContainer.postInvoke(EJSContainer.java:3986)
at com.ibm.was.services.EJSLocalStatelessMySessionBean_26b161bc.processMessage(Unknown Source)
at com.ibm.was.services.MNPBSCSServiceMDBean.processMessage(MyMDBean.java:86)


Thanks in advance,
Ankit
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am getting transaction roll back exception, while trying to call a session bean method with RequiresNew transaction attribute from onMessage of MDB. Any help to resolve this will be appreciated. I am using WAS 6.1.


This is a perfectly valid and legal scenario and it should work - it does in weblogic. Have you tried the IBM forums to check if there is a problem with this version of the server ? This javaranch post suggests it has.

cheers,
ram.
 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ram, thanks for your reply.

I think I figured out the problem. The Session bean was being invoked by WAS, though the overall transaction of SB was taking more time than the default transaction timeout of WAS, and that's why WAS was rolling back the MDB transaction with above exception. I increased the default transaction timeout of WAS and also tweaked the processing in SB to reduce the overall processing time and it worked.

Thanks again.
Ankit
 
cirrus logic
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using WAS 6.0 too.

Setting the transaction life time timeout value to a value like 1200 fixed the issue.

[11/4/11 13:20:15:719 SGT] 0000003a ExceptionUtil E CNTR0019E: EJB threw an unexpected (non-declared) exception during invocation of method "findByParamKey". Exception data: com.ibm.websphere.csi.CSITransactionRolledbackException: Transaction rolled back; nested exception is:
javax.transaction.TransactionRolledbackException: Transaction is ended due to timeout
at com.ibm.ejs.csi.TransactionControlImpl.completeTxTimeout(TransactionControlImpl.java(Compiled Code))
at com.ibm.ejs.csi.TransactionControlImpl.preInvoke(TransactionControlImpl.java(Compiled Code))
at com.ibm.ejs.container.EJSContainer.preInvokeActivate(EJSContainer.java(Compiled Code))
at com.ibm.ejs.container.EJSContainer.preInvoke(EJSContainer.java(Compiled Code))
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic