When using Spring ORM (4.3.9) and Hibernate (5.1.0) and using a Hibernate user type, on the second use of the type, I get an exception:
Caused by: java.sql.SQLException: PooledConnection has already been closed.
This appears to have been addressed previously in #15028, however the fix was implemented in org.springframework.orm.jpa.vendor.HibernateJpaDialect.HibernateConnectionHandle by checking Hibernate's SessionImpl for the prescence of a method called "connection" - this was present in Hibernate 3.x, but not in Hibernate 4.x, so it's existence was used to determine if HibernateConnectionHandle should close the connection.
However, in Hibernate 5.1.0, SessionImpl has a method called "connection" again - so HibernateConnectionHandle now does the Hibernate 3.x behavior if hibernate 5.x is being used, causing this error to re-surface
Affects: 4.3.9, 4.3.13
The text was updated successfully, but these errors were encountered:
Update: After some more classpath tweaking, it has become clear that HibernateConnectionHandle is not to blame - I was debugging into the wrong class. It checks the Session interface, which is still devoid of a "connection" method - SessionImpl is the class that still has one. While I am still seeing the closed exception, I do not think it is caused by the described behavior at this time.
I do not have the ability to remove/resolve this ticket, but if someone who can sees this, I think this can be resolved as not an issue