Sorry that I was not able to create a test case for this issue but I'm pretty sure that there is an issue introduced in Hibernate 5.2.2 related to connection release when an SQLGrammarException is thrown. Steps to reproduce: 1. Take a Spring application using JPA2 and hickaricp/c3p0 connection pool 2. Trigger an SQLGrammarException by messing up the schema 3. Each failed JPA query will leak one connection eventually starving the pool I attached the log that shows how c3p0 detects the leak (the same as hickaricp). For now I will stick to version 5.2.1.Final I hope that this issue will be fixed, sorry but I can't spend more time working on hibernate to create a proper test case, I need it to "just work". |