Session not flushing starting from 5.2.0 in Karaf + Aries JPA & JTA

Description

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:

EntityManagerImpl.java

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

Environment

Apache Karaf 4.0.5
install next bundles:
feature:install scr transaction pax-jdbc-config pax-jdbc-h2 pax-jdbc-pool-dbcp2 http-whiteboard jpa hibernate-orm/5.2.1.Final
and example from https://github.com/apache/aries/tree/trunk/jpa/examples
install -s mvn:org.apache.aries.jpa.example/org.apache.aries.jpa.example.tasklist.model/2.5.0-SNAPSHOT
> install -s mvn:org.apache.aries.jpa.example/org.apache.aries.jpa.example.tasklist.blueprint/2.5.0-SNAPSHOT

Assignee

Andrea Boriero

Reporter

Dmitriy Sulimchuk

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Critical
Configure