aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Transaction Rollback problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Transaction Rollback problem" Watch "Transaction Rollback problem" New topic
Author

Transaction Rollback problem

Ankit Doshi
Ranch Hand

Joined: Dec 04, 2002
Posts: 222
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

Joined: Jan 24, 2005
Posts: 489

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

Joined: Dec 04, 2002
Posts: 222
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

Joined: Nov 04, 2011
Posts: 1
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))
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transaction Rollback problem
 
Similar Threads
help required specifying Transation attributes for this scenario
setRollbackOnly not working
Transaction-propagation
Transaction between 2 methods in the same bean
Hard ICE question