GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
I'm using Snaplet-HDBC with HDBC-mysql, and currently running into a mysql error 2006 "MySQL server has gone away" when my site goes several hours without being used. What is the preferred way to check if the connection exists and reconnect if necessary?
Ok, it looks like using HdbcSnaplet Connection Pool instead of HdbcSnaplet Connection IO is the solution. The documentation states that for the latter,
HdbcSnaplet Connection Pool
HdbcSnaplet Connection IO
A resource pool is created with some default parameters that should be fine for most common usecases. If a custom resource pool configuration is desired, use thehdbcInit'initialiser instead...
A resource pool is created with some default parameters that should be fine for most common usecases. If a custom resource pool configuration is desired, use the
However, apparently the code has since changed so that this is no longer the case. Also, the hdbcInit' function no longer exists. I guess the documentation should be updated to reflect this.
There's another issue with this, which is that withResource doesn't bracket snap actions correctly (it'd need to use bracketSnap to do so properly in the presence of pass).