DBD-mysql - Re: mysql_auto_reconnect problems

Posted on Fri Jul 22 04:48:37 2005 by jspath in response to 776 (See the whole thread of 8)
Re: mysql_auto_reconnect problems

Thanks for your help itub! I ended up being able to build and install the latest version of DBD::mysql in my home directory and now the auto reconnect is functioning as expected. I guess I should RTFChangelog next time! :D

About your idea of reconnecting explicitly. I found one downside to this method, which I was using before I found out about mysql_auto_reconnect. Any statement handles that I had prepared before the disconnect needed to reprepared after reconnecting. When using mysql_auto_reconnect, it seems that I do not need to reprepare any of the statements. I could be wrong about this, but this is what I understood to be the case from my testing.

And one last note... it would be nice if mysql_auto_reconnect reconnected AND reexecuted statements. It seems a little silly to me to have to EXECUTE, test for a lost connection, then EXECUTE again if the connection dropped. I understand that this could be "dangerous", as losing the connection does not necessarily mean that the statement wasn't executed. At the same time, for the application I am developing, it's fine if the statement happens to execute twice, especially given that this would be a VERY VERY rare case. Just a suggestion to anyone who is listening ;)

Direct Responses: 779 | Write a response