aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/connection.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-02-21 10:42:13 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-02-21 10:42:13 +0200
commitcfc9c1fa3cab07396b38d192da3d0b6bfa36d0f5 (patch)
tree4070182474950d34f62fe5f2a828e160540753e6 /odb/mysql/connection.cxx
parent4acabe57939ff37bad0a8aabc5164b6d5add449b (diff)
Don't reuse failed connections
If MySQL API returns an error indicating the connection is no longer usable, mark it as failed. In connection_pool_factory free failed connections instead of returning them to the pool.
Diffstat (limited to 'odb/mysql/connection.cxx')
-rw-r--r--odb/mysql/connection.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/odb/mysql/connection.cxx b/odb/mysql/connection.cxx
index 1395592..7679e27 100644
--- a/odb/mysql/connection.cxx
+++ b/odb/mysql/connection.cxx
@@ -20,6 +20,7 @@ namespace odb
connection::
connection (database_type& db)
: db_ (db),
+ failed_ (false),
handle_ (&mysql_),
active_ (0),
statement_cache_ (new statement_cache_type (*this))