I just tested with MySQLdb 1.2.0 and MySQL 4.1.14 and it seems
reconnection happens automatically.
 >>> import MySQLdb
 >>> db = MySQLdb.connect()
 >>> db.thread_id()
 3
This is actually the 3-rd connection from the start of the Mysql
server... now I stop and start the daemon.
 >>> db.thread_id()
 3
 >>> c = db.cursor()
 >>> db.thread_id()
 3
 >>> c.execute('show databases')
 >>> db.thread_id()
 1
Oh now you reconnect.

But since Mysql 5.0.3 auto-reconnect is disabled by default (it was
enabled by default previosly) since it's considered dangerous (you
silently loose all the connection state).

http://dev.mysql.com/doc/refman/5.0/en/upgrading-from-4-1.html


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to