dbTalk Databases Forums  

Re: opt_reconnect patch

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Re: opt_reconnect patch in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Warren Young
 
Posts: n/a

Default Re: opt_reconnect patch - 12-15-2005 , 08:24 AM






Jalon, Arnon wrote:
Quote:
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.

Quote:
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.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #2  
Old   
Jalon, Arnon
 
Posts: n/a

Default RE: opt_reconnect patch - 12-15-2005 , 09:04 AM






------_=_NextPart_001_01C60188.CDFF32AD
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable


In case you didn't get the second zip that I sent, I'm pasting it here
(I commented it following the pattern of other comments):

Index: lib/connection.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
--- lib/connection.cpp (revision 1151)
+++ lib/connection.cpp (working copy)
@@ -95,6 +95,7 @@
Connection:pt_type_boolean, // opt_secure_auth
Connection:pt_type_boolean, // opt_multi_statements
Connection:pt_type_boolean, // opt_report_data_truncation
+ Connection:pt_type_boolean, // opt_reconnect
};


@@ -413,6 +414,10 @@
case opt_report_data_truncation:
return
set_option_impl(MYSQL_REPORT_DATA_TRUNCATION, &my_arg);
#endif
+#if MYSQL_VERSION_ID >=3D 50013
+ case opt_reconnect:
+ return
set_option_impl(MYSQL_OPT_RECONNECT, &my_arg);
+#endif
case opt_FIRST: // warning eater when using old
C APIs
default:
return bad_option(option,
opt_type_boolean);
Index: lib/connection.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
--- lib/connection.h (revision 1151)
+++ lib/connection.h (working copy)
@@ -101,6 +101,10 @@
// Set reporting of data truncation errors
opt_report_data_truncation,

+ // Enable or disable automatic reconnection to the
server if
+ // the connection is found to have been lost.
+ opt_reconnect,
+
// Number of options supported. Never send this to
// set_option()!
opt_COUNT







Arnon Jalon / Software Engineer
T: +1.212.231.7159 / F: +1.212.760.1774
arnon.jalon (AT) 247realmedia (DOT) com
24/7 Real Media, Inc. (NASDAQ: TFSM)
132 West 31st Street, 9th floor
New York, NY 10001
WWW.247REALMEDIA.COM
Quote:
DELIVERING TODAY >DEFINING TOMORROW=20

-----Original Message-----
From: Warren Young [mailto:mysqlpp (AT) etr-usa (DOT) com]=20
Sent: Thursday, December 15, 2005 9:24 AM
To: MySQL++ Mailing List
Subject: Re: opt_reconnect patch
=20
Jalon, Arnon wrote:
=20
mysql 5.0.13 introduced a flag that will allow the connection to=20
automatically reconnect if it lost its connection to the server for=20
some reason. I added a opt_reconnect flag to the=20
Connection class to=20
allow for this flag to be set.
=20
This sounds reasonable, but your patch didn't make it=20
through. Instead of trying to attach it, it may work better=20
in your mailer to simply cut-and-paste the text of the patch=20
into the email.
=20
I've tested it by setting the option in my Connection object before=20
connecting, and verified that it works. I was slightly confused=20
because I noticed that the Connection object will only apply the=20
options while it is connecting or if it is connected,=20
meaning that it=20
will only apply any options after real_connect has been called. =20
Looking at the MySql 5 documentation for mysql_options, it says=20
"|mysql_options()| should be called after |mysql_init()| and before=20
|mysql_connect()| or
|mysql_real_connect()|." Seeing as the behaviour=20
associated with the
flag I'm setting is working, I assume that that "should" is really=20
just a "should"?
=20
I don't have any specific advice for you here, but I will=20
observe that there are other cases where the exact timing of=20
when you set the option does matter. As long as MySQL++=20
remains MySQL-specific, this is at worst going to be a matter=20
of documentation. (On that note, I hope your patch includes=20
an appropriate update to the Doxygen comments.)
=20
If we ever do make MySQL++ database-independent, sorting this=20
out should probably become a feature, where the library=20
understands the rules for each database type.
=20
--=20
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: =20
http://lists.mysql.com/plusplus?unsu...edia (DOT) com
=20
=20
------_=_NextPart_001_01C60188.CDFF32AD
Content-Type: application/x-zip-compressed;
name="opt_reconnect.zip"
Content-Transfer-Encoding: base64
Content-Description: opt_reconnect.zip
Content-Disposition: attachment;
filename="opt_reconnect.zip"

UEsDBBQAAAAIAEpmiTMzhWNDDwIAAAAFAAATAAAAb3B0X3JlY2 9ubmVjdC5wYXRjaLVT74vaQBD9
nPwVUw6KkvgjnLY05YqSsxBoo9VcoZ+WTTJeQpPdsLvR+qH/e3dj6p3FHkKpgonDvJl5896ELMMf
PpRFMko5Y5iqgrNhWtf23b9/7MFgcKG01RO4K6T+B5439fq24zgX0/ZcfC/YI6S8PvTt2QwG76bu
G3D071uYzWywghPC93mtiDrUSBLOS6TMtUYjMEGJaSOQ0Ebl10 KqplQFkYoqrJApeS1OYM2FIhlV
lCjRsJQagO1ci+42YMPP9zbor+E88W4N6Yk3cb3xkbZlpVTiCx 39NskSqBrBQKIiOlfHSVHVZe/z
t82XT2S9WC3XMbmfx3MSrx+iYB6Hy8iF19WBUPHY1xPcIMuKre 3cFFs4gr4u1hudRcJ7+HAH0/HY
u9XszubpOPht/OURlqtYjxEso2gRxM87O13nM6ofw/Um9s2y9lQwYwzU+gjY58igkSbAywwCmK9C
2UIz3FKt5Pk2Epp1o/SODxf+VERPEF48jPx/nUV+zVHkl07CG3vGHuZxsode0QYVHL3R7mULxiHw
5BBAIbho1/R3G7nagk5bbsFoUmoZBGSFbF/1OfFKZ6VwktyUVRxUjlpvsdPSaN90BUzwWVohYcsb
lpn8nO4QEtQillyqoQGcOcm1nY5U1FSJrqrZHJWTIJvaDI7ZEC BC01KiqZrrBop3sCfz9fqvfjMO
lg9RbP8CUEsBAhQAFAAAAAgASmaJMzOFY0MPAgAAAAUAABMAAA AAAAAAAQAgAAAAAAAAAG9wdF9y
ZWNvbm5lY3QucGF0Y2hQSwUGAAAAAAEAAQBBAAAAQAIAAAAA


------_=_NextPart_001_01C60188.CDFF32AD
Content-Type: text/plain; charset=us-ascii


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw
------_=_NextPart_001_01C60188.CDFF32AD--


Reply With Quote
  #3  
Old   
Jalon, Arnon
 
Posts: n/a

Default RE: opt_reconnect patch - 12-19-2005 , 08:38 AM



Hate to pester you, Warren, but I was wondering if you had a chance to
take a look at the patch yet. We're going to be deploying some stuff,
which I'm hoping will make use of it, this week, and I guess we don't
want to deploy my patched version of 2.0.7, unless we have confirmation
that it will come in the next, or relatively next release. It's
relatively small, and seems pretty painless, but I would love to get the
official word. Thanks,

--Arnon

Arnon Jalon / Software Engineer
T: +1.212.231.7159 / F: +1.212.760.1774
arnon.jalon (AT) 247realmedia (DOT) com
24/7 Real Media, Inc. (NASDAQ: TFSM)
132 West 31st Street, 9th floor
New York, NY 10001
WWW.247REALMEDIA.COM
Quote:
DELIVERING TODAY >DEFINING TOMORROW=20

-----Original Message-----
From: Jalon, Arnon=20
Sent: Thursday, December 15, 2005 10:06 AM
To: MySQL++ Mailing List
Subject: RE: opt_reconnect patch
=20
=20
In case you didn't get the second zip that I sent, I'm=20
pasting it here (I commented it following the pattern of=20
other comments):
=20
Index: lib/connection.cpp
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
Quote:
--- lib/connection.cpp (revision 1151)
+++ lib/connection.cpp (working copy)
@@ -95,6 +95,7 @@
Connection:pt_type_boolean, // opt_secure_auth
Connection:pt_type_boolean, // opt_multi_statements
Connection:pt_type_boolean, // opt_report_data_truncation
+ Connection:pt_type_boolean, // opt_reconnect
};
=20
=20
@@ -413,6 +414,10 @@
case opt_report_data_truncation:
return=20
set_option_impl(MYSQL_REPORT_DATA_TRUNCATION, &my_arg); #endif
+#if MYSQL_VERSION_ID >=3D 50013
+ case opt_reconnect:
+ return=20
+set_option_impl(MYSQL_OPT_RECONNECT, &my_arg); #endif
case opt_FIRST: // warning eater when=20
using old C APIs
default:
return bad_option(option,=20
opt_type_boolean);
Index: lib/connection.h
=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3 D
Quote:
--- lib/connection.h (revision 1151)
+++ lib/connection.h (working copy)
@@ -101,6 +101,10 @@
// Set reporting of data truncation errors
opt_report_data_truncation,
=20
+ // Enable or disable automatic reconnection=20
to the server if
+ // the connection is found to have been lost.
+ opt_reconnect,
+
// Number of options supported. Never send this to
// set_option()!
opt_COUNT
=20
=20
=20
=20
=20
=20
=20
Arnon Jalon / Software Engineer
T: +1.212.231.7159 / F: +1.212.760.1774
arnon.jalon (AT) 247realmedia (DOT) com
24/7 Real Media, Inc. (NASDAQ: TFSM)
132 West 31st Street, 9th floor
New York, NY 10001
WWW.247REALMEDIA.COM
DELIVERING TODAY >DEFINING TOMORROW
=20
-----Original Message-----
From: Warren Young [mailto:mysqlpp (AT) etr-usa (DOT) com]
Sent: Thursday, December 15, 2005 9:24 AM
To: MySQL++ Mailing List
Subject: Re: opt_reconnect patch
=20
Jalon, Arnon wrote:
=20
mysql 5.0.13 introduced a flag that will allow the connection to=20
automatically reconnect if it lost its connection to the=20
server for=20
some reason. I added a opt_reconnect flag to the
Connection class to
allow for this flag to be set.
=20
This sounds reasonable, but your patch didn't make it through. =20
Instead of trying to attach it, it may work better in your=20
mailer to=20
simply cut-and-paste the text of the patch into the email.
=20
I've tested it by setting the option in my Connection=20
object before=20
connecting, and verified that it works. I was slightly confused=20
because I noticed that the Connection object will only apply the=20
options while it is connecting or if it is connected,
meaning that it
will only apply any options after real_connect has been called. =20
Looking at the MySql 5 documentation for mysql_options, it says=20
"|mysql_options()| should be called after |mysql_init()|=20
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"=20
is really=20
just a "should"?
=20
I don't have any specific advice for you here, but I will=20
observe that=20
there are other cases where the exact timing of when you set the=20
option does matter. As long as MySQL++ remains=20
MySQL-specific, this=20
is at worst going to be a matter of documentation. (On=20
that note, I=20
hope your patch includes an appropriate update to the Doxygen=20
comments.)
=20
If we ever do make MySQL++ database-independent, sorting this out=20
should probably become a feature, where the library understands the=20
rules for each database type.
=20
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: =20
http://lists.mysql.com/plusplus?unsu...edia (DOT) com
=20
=20
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Warren Young
 
Posts: n/a

Default Re: opt_reconnect patch - 12-20-2005 , 01:50 AM



Jalon, Arnon wrote:
Quote:
Hate to pester you, Warren,
It needed doing.

Quote:
we don't
want to deploy my patched version of 2.0.7, unless we have confirmation
that it will come in the next, or relatively next release.
I don't know when the next release will be, but you may take some
comfort from knowing that it's been committed to Subversion.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Jalon, Arnon
 
Posts: n/a

Default RE: opt_reconnect patch - 12-20-2005 , 08:27 AM



Great! Thanks a lot. Have a great Holiday Season everyone!

--Arnon

Arnon Jalon / Software Engineer
T: +1.212.231.7159 / F: +1.212.760.1774
arnon.jalon (AT) 247realmedia (DOT) com
24/7 Real Media, Inc. (NASDAQ: TFSM)
132 West 31st Street, 9th floor
New York, NY 10001
WWW.247REALMEDIA.COM
Quote:
DELIVERING TODAY >DEFINING TOMORROW=20

-----Original Message-----
From: Warren Young [mailto:mysqlpp (AT) etr-usa (DOT) com]=20
Sent: Tuesday, December 20, 2005 2:50 AM
To: MySQL++ Mailing List
Subject: Re: opt_reconnect patch
=20
Jalon, Arnon wrote:
Hate to pester you, Warren,
=20
It needed doing.
=20
we don't
want to deploy my patched version of 2.0.7, unless we have=20
confirmation that it will come in the next, or relatively=20
next release.
=20
I don't know when the next release will be, but you may take=20
some comfort from knowing that it's been committed to Subversion.
=20
--=20
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: =20
http://lists.mysql.com/plusplus?unsu...edia (DOT) com
=20
=20
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.