• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA UserTransaction not rolled back

 
Jochem Pim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This catch is not rollingback
Maybe your problem is here.
 
Jochem Pim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jochem Pim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tested if the code reached that part and it didn't:

 
Jochem Pim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic