CDB using Hibernate Envers

2011-10-21
2013-04-29
  • I tried to use CDB with Envers, but no changes are written to the audit tables. Is there a problem with UserTransactionManager.commitUserTransaction(); and the JTATransactionManager not responding?

     
  • Partially solved: It was a misconfiguration in my hibernate-config.xml. Envers now tries to write audit records, but fails because session is closed.

     
  • Solved. I had to fix org.hibernate.envers.synchronization.AuditProcess doBeforeTransactionCompletion():
    Changed
    if (FlushMode.isManualFlushMode(session.getFlushMode())) {
    to
    if (FlushMode.isManualFlushMode(session.getFlushMode()) || session.isClosed()) {
    so that a temporary session is opened, when the session was closed.