Re: How to detect a disconnected database ?
Kevin Rosenberg <kevin-HJRc7zDS/[email protected]>
| Newsgroups | gmane.lisp.clsql.devel |
|---|---|
| Message-ID | <[email protected]> |
Massimiliano Campagnoli wrote: > We are running a Lisp application connectetd to an IBM DB2 database via > ODBC. > During the night the dbms runs an off-line backup so all applications > (included the lisp one) are forced by the dbms to disconnect. > Unfortunately (CLSQL:CONNECTED-DATABASES) reports the the connection is > still up and running which is not true any more after the backup. > So how can we detect that the connection is no more valid because the > dbms dropped it and not because lisp called (CLSQL:DISCONNECT) ? That functionality will be database-backend specific. Most likely, each database backend could have some way to test if a database object is still connected. For mysql, I've seen some code that gives the SQL command "SHOW SLAVE STATUS" to test if the connection is still active. Kevin