I\'m using red5 1.0.0rc1 to create an online game. I\'m connecting to a MySQL database using a jdbc mysql connector v5.1.12
it seems that after several hours of idle
The MySQL JDBC driver has an autoreconnect feature that can be helpful on occasion; see "Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J"1, and read the caveats.
A second option is to use a JDBC connection pool.
A third option is to perform a query to test that your connection is still alive at the start of each transaction. If the connection is not alive, close it and open a new connection. A common query is SELECT 1
. See also:
A simple solution is to change the MySQL configuration properties to set the session idle timeout to a really large number. However:
1 - If the link breaks (again), please Google for the quoted page title then edit the answer to update it with the new URL.