Uploaded image for project: 'Hibernate ORM'
  1. HHH-11232

Session closed exception when using Envers in a JTA transaction

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects versions: 5.2.0, 5.2.1, 5.2.2, 5.2.3, 5.2.4
    • Fix versions: 5.2.5
    • Labels:
      None
    • Environment:
      Spring, JTA
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      After upgrade from Hibernate 5.1.0 releate to 5.2.4 there is error with JTA Transactions with Spring and Envers audited JPA entities.

      Session is closed before AuditProces insert revision data. Spring JtaTransactionManager closed it in commit() and nested synchronization releaseResource() method.
      Before Hibernate 5.2.0 session was not closed when in active transaction.

      In attachment is unit test (JtaTransactionWithSpringReleaseResource.java) for Envers where entityManager.close() method is invoked in transaction. In 5.1.x codebase is running without errors.
      Complete runable maven project with configured Spring, Hibernate, JTA and unit test is in another attachment.

      Thank you for quick response.

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: