commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pruitt, Byron S" <>
Subject [dbcp] auto reconnecting
Date Wed, 07 Oct 2015 19:35:24 GMT
My server has long standing idle periods.  We are seeing:  com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
The last packet successfully received from the server was...  errors.

I would like to fix it as simply as possible.  MySQL has two properties autoReconnect and
autoReconnectForPools that might fix the problem.  They both default to false and I can't
find an easy way to set them.
I had an earlier problem with auto commit and I fixed it with the setDefaultAutoCommit method
on PoolableConnectionFactory.  But, it doesn't have a similar setter for auto reconnect.

The only example I found of setting the autoReconnect property is on the connection url. 
I use the interface where I pass an instance of Properties, so I assume I can set those properties
with it.

I am curious if there are better ways to set those properties.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message