void close()
Close an application-managed entity manager.
After invocation of close(), every method of the EntityManager instance and of any instance of Query, TypedQuery, or StoredProcedureQuery obtained from it throws the IllegalStateException, except for getProperties(), getTransaction(), and isOpen() (which returns false).
If this method is called when the entity manager is joined to an active transaction, the persistence context remains managed until the transaction completes.
- Throws:
- IllegalStateException - if the entity manager is container-managed
- Since:
- JPA 1.0