Hibernate 5 ConnectionProvider not calling closeConnection

Hi,

We’re migrating from Hibernate 3 to Hibernate 5. We had freezing issues after migrating. After some investigation we found that Hibernate 5 is not calling our ConnectionProvider closeConnection for some of our transaction. We added logs in getConnection and closeConnection and there is clearly a difference in call count.

Anybody has an idea why Hibernate would not call closeConnection?

Regards,

Nestor