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
>
Dieter Maurer wrote:
> 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
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 rest
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
or
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 ev
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
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. Stil
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
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
Jim Washington wrote:
> Florent Guillaume wrote:
>
>> Jim Washington wrote
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 hand
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 handle the
case where the c
-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,
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 by
13 matches
Mail list logo