DataSourceTransactionManager contains a bug when releasing the connection. According to the official recommendation, The problem here is that the code only releases the connection when an exception occurs, not when an Error. In our case when an OutOfMemoryError occurs we notice that the connections are not released. Here is the code snipped from doBegin()
The problem is that OOM can be recovered, but not releasing the connections cannot be recovered.
Not sure how much it is related, but when I see abandoned JDBC connections I also see these in the log file :