-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Rollback not working for entity with children
PostPosted: Mon Mar 10, 2014 7:44 pm 
Newbie

Joined: Tue Oct 29, 2013 5:07 am
Posts: 5
Hello everybody!
I have the next application configuration: Karaf 2.3.1; Hibernate jpa-2.0 1.0.1.Final; Hibernate - 4.2.7.Final; Postgress 9.2.

I have one proven case when changes in DB will not remove after transaction is roll-backed.

Case is very specific and rollback works fine for all other cases in this environment.
Problematic case is:
- Mapped entities: A has B as child. B has C as child;
- New entity A and it’s new child B and it’s new child C prepared;
- New entity persisted by one getEntityManager().persist(A) command. During this actin 3 related tables are populated.
- After this DB operation but within scope of the same container managed transaction code throws exception.
- Newly 3 created records are in DB. But it is wrong!

According the log transaction was roll-backed
Code:
| Clearing up EntityManager org.apache.aries.jpa.container.impl.EntityManagerWrapper@5c660d79 as the transaction has completed.
| Closing session
| Closing JDBC container [org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl@7860eaa7]
| HHH000420: Closing un-released batch
| Closing logical connection
| Logical connection closed
| JTA sync : afterCompletion(4)
| Transaction afterCompletion callback [status=4]
| Session was closed; nothing to do
| after transaction completion
| Aggressively releasing JDBC connection
| after transaction completion


Any ideas or suggestions are welcome.
Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Rollback not working for entity with children
PostPosted: Wed Mar 12, 2014 1:28 pm 
Newbie

Joined: Tue Oct 29, 2013 5:07 am
Posts: 5
A small but important clarification.

I have clear evidence that our project, environment and transaction configuration is correct. When entity A without children persisted, transaction and rollback working absolutely fine.

So we have only one specific case when rollback doesn't work.
In log I could see tha same set of messages for seccessful and failed rollback cases. And according the messages rollback was performed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.