java.lang.IllegalStateException: Session/EntityManager is closed

tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Karaf 4.0.6 Transactional method closes at exit EntityManager so UserTransaction at upper level fails to commit

    Stack Overflow | 5 months ago | Dmitry Lukasevich
    java.lang.IllegalStateException: Session/EntityManager is closed

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Session/EntityManager is closed

      at org.hibernate.internal.AbstractSharedSessionContract.checkOpen()
    2. Hibernate
      EntityType.getIdentifier
      1. org.hibernate.internal.AbstractSharedSessionContract.checkOpen(AbstractSharedSessionContract.java:328)[87:org.hibernate.core:5.2.2.Final]
      2. org.hibernate.engine.spi.SharedSessionContractImplementor.checkOpen(SharedSessionContractImplementor.java:126)[87:org.hibernate.core:5.2.2.Final]
      3. org.hibernate.internal.SessionImpl.getContextEntityIdentifier(SessionImpl.java:1653)[87:org.hibernate.core:5.2.2.Final]
      4. org.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:271)[87:org.hibernate.core:5.2.2.Final]
      5. org.hibernate.type.EntityType.getIdentifier(EntityType.java:462)[87:org.hibernate.core:5.2.2.Final]
      5 frames