You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the MySQLPool's onNewConnection callback does not fire when an existing connection has been closed and re-connects. Given the callback's name is "onNewConnection", I think that is entirely appropriate.
However, there needs to also be a callback which gets triggered every time a connection reconnects. This is necessary to correctly handle many of MySQL's connection-specific configuration settings.
Unlike the existing onNewConnection, this onReconnect callback needs to be a member of Connection (although there should also be corresponding onReconnect in MySQLPool).
The text was updated successfully, but these errors were encountered:
This would solve the issue, but I would stress it needs to be settable in the pool, not just the connection.
Note that it's not entirely clear in what cases onNewConnection from the pool works. In my use case, I do not close any pool connections, I'm relying on the auto reconnect inside Connection to make sure it keeps working. So is onNewConnection called whenever a connection is established when locking a connection, or is it always called when I lock a connection? Or is it only called whenever a new connection object is created? It should be explained more in the docs.
As discussed in #176:
Currently, the MySQLPool's onNewConnection callback does not fire when an existing connection has been closed and re-connects. Given the callback's name is "onNewConnection", I think that is entirely appropriate.
However, there needs to also be a callback which gets triggered every time a connection reconnects. This is necessary to correctly handle many of MySQL's connection-specific configuration settings.
Unlike the existing onNewConnection, this onReconnect callback needs to be a member of Connection (although there should also be corresponding onReconnect in MySQLPool).
The text was updated successfully, but these errors were encountered: