Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EJB transaction rolled back exception

I am using ejb-2 I get the following exception. Can someone tell me what does it mean, and what can be the possible solution for this:

Error (fatal): EJB Exception: ; nested exception is:
javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is:
weblogic.transaction.internal.AppSetRollbackOnlyException

like image 425
sindhu Avatar asked Jan 14 '13 07:01

sindhu


2 Answers

Try to find out what the real exception is. To do this, transform your ejb to use bean managed transaction. Then you can commit manually and can catch the exception the commit throws.

WebLogic likes to hide exceptions thrown in commit phase when using container managed transaction. Usually the reason is a database constraint what is not known by the EJB tier, eg. a function-based unique index in Oracle.

like image 184
Donato Szilagyi Avatar answered Oct 04 '22 04:10

Donato Szilagyi


I was also facing the same problem. I just want to share my experience with you all. It is right that the actual exception is not mentioned in this aforesaid exception. To reveal that exception I have used wlspy.jar tool. Using this tool I got the inner sql activity in configured log file. Due to which I got the hidded sql constraint exception. Steps to Configure: 1) Add wlspy.jar in your weblogic server classpath. 2) Add configurations related to wlspy in database source.

For example:

jdbc:bea:DB2://db2host:50000;spyAttributes=(log=(file)/opt/bea/logs/mySpy.log;timestamp=yes)

After that restart your weblogic server and do the activity. You will get database related logs in mySoy.log file. In my case I got the actual constraint exception.

Go through this link: http://docs.oracle.com/cd/E21764_01/web.1111/e13753/spy.htm#JDBCD469

like image 22
A_proud_indian Avatar answered Oct 04 '22 04:10

A_proud_indian