so first thing was to confirm if this was really the case because our transaction timeout for long running queries is also 20 min but that has been for ages so this abandoned was the only recent change. Finally I found logAbandoned would log into tomcat catalina.out and I indeed saw this
Jun 18, 2014 3:54:07 PM org.apache.tomcat.jdbc.pool.ConnectionPool abandon
WARNING: Connection has been abandoned PooledConnection[com.mysql.jdbc.JDBC4Connection@2ba0c302]:java.lang.Exception
So now only thing left is to fix it.
There are two approaches:
- While iterarting resultset reset the abandoned timer for long running job using ResetAbandonedTimer
- Or for now just use dataSource.setAbandonWhenPercentageFull(50);