Meaningless Drivel is fun!*
The moose likes EJB and other Java EE Technologies and the fly likes JPA UserTransaction not rolled back Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JPA UserTransaction not rolled back" Watch "JPA UserTransaction not rolled back" New topic
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPA UserTransaction not rolled back
 
Similar Threads
ejbCreate -permitted and prohibited operations -
JTA Application Managed EntityManager question
Handling errors when running SQL query
Insert or Update (Hibernate JPA + Jboss 5.0.0GA)
JPA transaction rollback fails with call to stateless bean