27 Jan
2000
27 Jan
'00
12:32 p.m.
Andreas wrote:
"Daniel G. Rusch" wrote:
Try this, where Database is the name of your database object <dtml-if "Database.connected()"> Yes <dtml-else> No </dtml-if> I use ZPyGreSQLDA. The function connected() returns the value self._v_connected (DateTime of last connect call) of the Connection object. So if the SQL server crashes while Zope is still working the result of connected() is still 'true' although a query will fail :-(
I have modified UserDB to just do close/open on the connection if the query fails. You could do something similar - by doing a dummy query (like "select 1") and checking if it succeeds. -------- Hannu