MySQL Lists are EOL. Please join:

List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:December 15 2005 2:24pm
Subject:Re: opt_reconnect patch
View as plain text  
Jalon, Arnon wrote:
> mysql 5.0.13 introduced a flag that will allow the connection to 
> automatically reconnect if it lost its connection to the server for some 
> reason.  I added a opt_reconnect flag to the Connection class to allow 
> for this flag to be set.

This sounds reasonable, but your patch didn't make it through.  Instead 
of trying to attach it, it may work better in your mailer to simply 
cut-and-paste the text of the patch into the email.

> I've tested it by setting the option in my Connection object before 
> connecting, and verified that it works.  I was slightly confused because 
> I noticed that the Connection object will only apply the options while 
> it is connecting or if it is connected, meaning that it will only apply 
> any options after real_connect has been called.  Looking at the MySql 5 
> documentation for mysql_options, it says "|mysql_options()| should be 
> called after |mysql_init()| and before |mysql_connect()| or 
> |mysql_real_connect()|."  Seeing as the behaviour associated with the 
> flag I'm setting is working, I assume that that "should" is really just 
> a "should"?

I don't have any specific advice for you here, but I will observe that 
there are other cases where the exact timing of when you set the option 
does matter.  As long as MySQL++ remains MySQL-specific, this is at 
worst going to be a matter of documentation.  (On that note, I hope your 
patch includes an appropriate update to the Doxygen comments.)

If we ever do make MySQL++ database-independent, sorting this out should 
probably become a feature, where the library understands the rules for 
each database type.
opt_reconnect patchArnon Jalon9 Dec
  • Re: opt_reconnect patchWarren Young15 Dec
RE: opt_reconnect patchArnon Jalon14 Dec
RE: opt_reconnect patchArnon Jalon15 Dec
RE: opt_reconnect patchArnon Jalon19 Dec
  • Re: opt_reconnect patchWarren Young20 Dec
RE: opt_reconnect patchArnon Jalon20 Dec