Re: [Zope3-dev] Re: rdb: Disappearing Connection

2006-01-13 Thread Brian Sutherland
Hi, Thanks for posting this, it saved me quite a few hours. On Fri, Dec 16, 2005 at 04:23:36PM -0500, Jim Washington wrote: def isConnected(self): try: self._v_connection.ping() except: # not connected or ping did not restore MySQL connection

Re: [Zope3-dev] Re: rdb: Disappearing Connection

2005-12-27 Thread Dieter Maurer
Jim Washington wrote at 2005-12-16 16:23 -0500: ... What seems to work for me now is the following as mysqldbda.adapter.MySQLdbAdapter.isConnected() def isConnected(self): try: self._v_connection.ping() except: # not connected or ping did not restore

Re: [Zope3-dev] Re: rdb: Disappearing Connection

2005-12-15 Thread Dieter Maurer
Jim Washington wrote at 2005-12-13 21:40 -0500: ... Now, looking closer at the code, a ping like this might be not too bad, because isConnected() is only called when a connection is requested, not for every SQL statement executed. So, it might not be so onerous as originally thought. Still

[Zope3-dev] Re: rdb: Disappearing Connection

2005-12-15 Thread jürgen Kartnaller
Dieter Maurer wrote: Jim Washington wrote at 2005-12-13 21:40 -0500: ... Now, looking closer at the code, a ping like this might be not too bad, because isConnected() is only called when a connection is requested, not for every SQL statement executed. So, it might not be so onerous as

Re: [Zope3-dev] Re: rdb: Disappearing Connection

2005-12-15 Thread Velko Ivanov
jürgen Kartnaller wrote: MySQL::Ping will automatically reopen a closed connection in a way where the existing connection object can still be used. If MySQL::Ping fails something really bad is going on. To reduce the number of ping's in my application I used a timer which was tested before

Re: [Zope3-dev] Re: rdb: Disappearing Connection

2005-12-14 Thread Jim Washington
jürgen Kartnaller wrote: Without going much deeper into the way zope uses database connections. Wouldn't MySQL:Ping solve the reconnect Problem. That's what I used in my old C++ projects. Some kind of ensureConnected at the right place. Jürgen Thanks! I'll look into it. -Jim Washington

[Zope3-dev] Re: rdb: Disappearing Connection

2005-12-13 Thread Florent Guillaume
Jim Washington wrote: Spelunking a bit in the code, zope.app.rdb.ZopeDatabaseAdapter.isConnected() looks at whether _v_connection is present, not whether the connection is actually alive. If we fix this here, isConnected() perhaps should handle the case where the connection might be reaped

[Zope3-dev] Re: rdb: Disappearing Connection

2005-12-13 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Florent Guillaume wrote: Jim Washington wrote: Spelunking a bit in the code, zope.app.rdb.ZopeDatabaseAdapter.isConnected() looks at whether _v_connection is present, not whether the connection is actually alive. If we fix this here,

Re: [Zope3-dev] Re: rdb: Disappearing Connection

2005-12-13 Thread Jim Washington
Jim Washington wrote: Florent Guillaume wrote: Jim Washington wrote: Spelunking a bit in the code, zope.app.rdb.ZopeDatabaseAdapter.isConnected() looks at whether _v_connection is present, not whether the connection is actually alive. If we fix this here, isConnected() perhaps should