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.