When I don\'t make any database queries for some time I think it must sleep - if you then call it an exception is thrown;
java.sql.SQLNonTransientConnectionE
This may be stretching your memory but could
for some time
have been 8+ hours? If so, likely to be the MySQL inactivity timeout, which disconnects after 28800 seconds. I hit this problem recently and found a few SO questions about it - this answer contained the best simple nuggets for solving the problem. In short, would suggest adding a validationQuery
of SELECT 1
and setting testOnBorrow = true
in the DBCP connection pool properties.