Hi Jim,
Jim Washington wrote:
The situation I wish to handle is the case where MySQL server silently
closes its connection with Zope after 8 hours idle, which likely will
happen at least once a day.
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 MySQL connection
if self._v_connection is not None:
self._v_connection.close()
self._v_connection = None
return False
return True
After experiencing 'Mysql server had gone away' errors I quickly found
this thread.
If I interpret the course of discussion correctly, the above isConnected
implementation solved this problem for you, right?
I add this implementation of isConnected to the mysqldbda in my setup
(Zope-2.9 + Five + sqlos, mysql 4.1.12) too, and things *seem* to have
improved. But not completely, every now and then I get the gone away
errors again.
Question is, was this indeed the final conclusion for this thread and
did it solve the problem for you completely - i.e. do you not get the
gone away errors anymore?
kind regards,
jw
--
Jan-Wijbrand Kolman
[EMAIL PROTECTED]
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com