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

EntityManager.close() should throw an ISE if called on already closed EntityManager

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: None
    • Fix versions: 5.3.0.CR2
    • Components: None
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

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

      Description

      Calling EntityManager.close() on an already closed entity manager, should throw an IllegalStateException. From JPA2.2 spec:

      /**
      * Close the factory, releasing any resources that it holds.
      * After a factory instance has been closed, all methods invoked
      * on it will throw the IllegalStateException, except for isOpen,
      * which will return false. Once an EntityManagerFactory has
      * been closed, all its entity managers are considered to be
      * in the closed state.
      * @throws IllegalStateException if the entity manager factory
      * has been closed
      */
      public void close();
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: