After org.hibernate.jpa.internal.EntityManagerImpl were moved into org.hibernate.internal. SessionImpl in release 5.2.0 session doesn't flush because SessionImpl.close() session now releasing JDBC resources even if transaction in progress. in 5.1.0 EntityManagerImpl.close() method entity manager looks like this:
public void checkOpen(boolean markForRollbackIfClosed) {
if(!this.isOpen()) {
if(markForRollbackIfClosed) {
this.markForRollbackOnly();
}
throw new IllegalStateException("EntityManager is closed");
}
}
as you might see - session not closing when there is active transaction, but now it close explicitly i think it's need to add the same logic into SessionImpl.close() method or return old class. i attach logs with old behaviour (5.1.0.FINAL) and new (5.2.1.FINAL) and screenshots where i emphasize problem |