EntityManager.close() with an active resource-local transaction

Previously EntityManager.close() threw an InvalidStateException while a resource-local transaction was active; a deferred close existed only for managed (JTA) transactions with the CloseOnManagedCommit compatibility flag. As required by sections 3.3.2 and 7.7 of the specification, close() now always returns and the persistence context is released when the transaction completes: isOpen() reports false immediately while em.getTransaction().commit()/rollback() remain callable.

Code that relied on the exception to detect a leaked open transaction must check em.getTransaction().isActive() itself and end the transaction explicitly. There is no option to restore the exception.