[Zope] Checking the state of a database connection

Andreas andreas@aHIT.de
Thu, 27 Jan 2000 11:15:57 -0700


"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 :-(
 
_________________________________________________________
Andreas Heckel                            andreas@aHIT.de