On Friday 04 August 2006 14:59, sophana wrote:
> I waited 8 hours, the sqlobject patch doesn't work. It goes in an
> infinite loop.
> It's worse...

That's because your python-mysqldb module doesn't support reconnecting.
You need to patch python-mysqldb for this to work if you use mysql-5.x

And the mysql backend should only retry 3 times. Retrying forever is 
indeed a bad idea and 3 times is enough to reestablish the connection 
(from experience when a 2006 comes is followed by a 2013 and the 3rd time 
it reconnects)

With the patch to unify the backend exceptions, code can be added to 
dbconnections to capture DatabaseConnectionError and reestablish the 
connection if the backend doesn't do this automatically. Then it will no 
longer need to import backend specific modules in dbconnection and will 
work with an un-patched python-mysqldb module.

Attached is the patch that should fix python-mysqldb to reconnect with 
mysql-5.x (as I've said this patch is included in debian testing/unstable 
so those users need not to worry about this, however if you use 
python-mysqldb from somewhere else you need this patch).

Check if with both this patch and the one you already applied to sqlobject 
(the test for the 2006 code), if it fixes your problem (it should as I no 
longer have the issue after applying both)

>
> will try the mysqldb patch.
>

-- 
Dan
--- python-mysqldb-1.2.1c3/_mysql.c	2005-05-12 05:02:55.000000000 +0300
+++ t/python-mysqldb-1.2.1c3/_mysql.c	2006-01-13 23:47:23.000000000 +0200
@@ -530,6 +530,8 @@
 	if (!conn) {
 		_mysql_Exception(self);
 		return -1;
+	} else {
+		conn->reconnect = 1;
 	}
 	/*
 	  PyType_GenericAlloc() automatically sets up GC allocation and
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to