"TransactionRequiredException: no transaction is in progress" during flush of application managed entity manager in JBoss EAP

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.2
    • 7.3
  • Hibernate
    • 5.3

Issue

  • An application managed entity manager is created.

  • A JTA transaction is initiated (e.g. during a CMT or BMT context)

  • During EntityManager.flush() an exception is raised

    ... javax.persistence.TransactionRequiredException: no transaction is in progress
    
  • No exception occurred in Hibernate 5.1 / EAP 7.1.

Resolution

Root Cause

This is a known defect (Content from hibernate.atlassian.net is not included.HHH-13936).

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.