Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PooledConnection Has Already Been Closed Exception with Hibernate 5.1.0 [SPR-16272] #20819

Closed
spring-projects-issues opened this issue Dec 6, 2017 · 1 comment
Assignees
Labels
in: data status: invalid

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Dec 6, 2017

Ryan O'Meara opened SPR-16272 and commented

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

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Dec 6, 2017

Ryan O'Meara commented

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

@spring-projects-issues spring-projects-issues added type: bug status: invalid in: data labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug label Jan 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data status: invalid
Projects
None yet
Development

No branches or pull requests

2 participants