is there a more clever way to see if revOpenDatabases() contains a valid value?

Josh Mellicker josh at dvcreators.net
Thu Apr 19 20:59:40 EDT 2007


I am looking for a way to check for a valid connection to a remote  
MySQL database (without running a test query)...

Here is the problem:

1. we connect to MySQL database

2. revOpenDatabases() contains valid value, all is fine

3. every 10 minutes, our office loses internet connectivity, this  
could be the culprit- OR, our MySQL server disconnects connects  
clients after a period of inactivity, not sure which, but it doesn't  
matter, because I need to find a solution that works in any event  
that connection is lost

4. at this point, revOpenDatabases() still returns a value, but there  
is no connection, running a query or any DB command hangs the  
software, forcing a force quit

If I revCloseDatabases() or resetAll and establish a new connection  
before making any database command all is fine, but I am thinking  
this is an inefficient approach... or is it?


So I am wondering if there is any clever way, perhaps through  
checking sockets or other network wizardry, to verify a valid MySQL  
database connection before actually executing a database command?


More information about the use-livecode mailing list