We have seen exceptions in production related to some misconfiguration of our Infinispan / JGroups clustering. Another story. What happened was an SQLException is thrown when Hibernate tried to release a ResultSet, this resulted in a RuntimeException (as the SQLException is rethrown as an UndeclaredThrowableException) and misses the connection.close() which leaves hanging connections and eventually connection starvation.
What do you think about putting the connection.close() in JdbcCoordinatorImpl.close(JdbcCoordinatorImpl.java:190) into a finally block?
Here is the exception stacktrace that we are seeing that is causing this issue: