| Author |
JPA UserTransaction not rolled back
|
Jochem Pim
Greenhorn
Joined: Dec 08, 2011
Posts: 6
|
|
The BMT(transaction) in the following code isn't rolled back after an exception. I use EJB 3.1 with JPA 2.0. My programs calls TaskExecutor:executeTask(Task) to begin.
As you might guess, the SomeEntity is in the database after the transaction is rolled back.
If you are interested, this is my persistence.xml:
To be complete, here is the essential part of SomeEntity:
Why is the SomeEntity in the database after the UserTransaction is rolled back?
|
 |
Hebert Coelho
Ranch Hand
Joined: Jul 14, 2010
Posts: 754
|
|
This catch is not rollingback
Maybe your problem is here.
|
[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
|
 |
Jochem Pim
Greenhorn
Joined: Dec 08, 2011
Posts: 6
|
|
Hebert Coelho wrote:Maybe your problem is here.
The program newer reached that part of the code. The java.lang.ArithmeticException is caught in the first catch.
|
 |
Hebert Coelho
Ranch Hand
Joined: Jul 14, 2010
Posts: 754
|
|
|
What about the others: SecurityException | IllegalStateException | NotSupportedException | SystemException ex
|
 |
Jochem Pim
Greenhorn
Joined: Dec 08, 2011
Posts: 6
|
|
I tested if the code reached that part and it didn't:
|
 |
Jochem Pim
Greenhorn
Joined: Dec 08, 2011
Posts: 6
|
|
After some extensive research, the problem seams to be different.
I created a new post here: http://www.coderanch.com/t/561174/EJB-JEE/java/JPA-transaction-rollback-fails-call
|
 |
 |
|
|
subject: JPA UserTransaction not rolled back
|
|
|