Please sign in to comment.
Attempt to detect more disconnect errors in the mysql2 adapter
Thanks to brianmario for some additional input. If the connection object is available, call ping on it to see if the connection is alive, and assume disconnection if not. In addition to checking to the exception message, also check the sql_state, similar to what is done in the JDBC adapter. Not all disconnect errors have similar SQL states, so continue to use the exception message as a fallback.
- Loading branch information...
Showing with 10 additions and 1 deletion.