summaryrefslogtreecommitdiff
path: root/odb/mysql/connection.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-02-21 12:06:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-02-21 12:06:03 +0200
commit81c2f16a9826d92cf5b54da71f70943263878d3e (patch)
treee71b970490eca51a515e4d1f259e543f20b68bb9 /odb/mysql/connection.hxx
parent6c85f1a50e3b50d18599143e18ee145fc6afdb08 (diff)
Validate connection in MySQL pool factory
This will help deal with the MySQL server closing connections after a certain period of inactivity.
Diffstat (limited to 'odb/mysql/connection.hxx')
-rw-r--r--odb/mysql/connection.hxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/odb/mysql/connection.hxx b/odb/mysql/connection.hxx
index 6704f23..16d3438 100644
--- a/odb/mysql/connection.hxx
+++ b/odb/mysql/connection.hxx
@@ -58,6 +58,13 @@ namespace odb
failed_ = true;
}
+ // Ping the server to make sure the connection is still alive. Return
+ // true if successful, mark the connection as failed and return false
+ // otherwise. This function can also throw database_exception.
+ //
+ bool
+ ping ();
+
public:
MYSQL*
handle ()