|
|||||||||||
|
RE: unsuccessful queries and lost connection
From: Jim Wallace <jwallace(at)kaneva.com>
Date: Wed Jul 25 2007 - 07:50:25 EDT
catch is the correct way to deal with it. What you do then is application specific. Search the mailing list for "connection" or "retry" since there has been quite a few postings on retry methods. I posted my try/catch macros some time back. If you can't find them e-mail me and I'll send you a sample of what I do.
-----Original Message-----
Hi all, I'm programming a piece of software that continuously looks up if it has pending sql queries (UPDATE and INSERT) and executes them. I should also control if I lost the db connection or if a sql query was unsuccessful. My question is: in what circumstances could I lose the connection to the db and how would I realize it? I have found in the refman a mysqlpp::BadQuery class. Just something like this? try {
mysqlpp::Query sqlQuery = sqlConn.query();
sqlQuery << q;
} Is there a better way to deal with errors? I only want to know if it occurred an error, I am not interested in other stats or results.
Thanks in advance,
-- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=lists@pantek.comReceived on Wed Jul 25 07:50:42 2007 This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:28:34 EDT |
||||||||||
|
|||||||||||