diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-01 12:09:07 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-12-01 12:09:07 +0200 |
commit | dce9ac4635ec667a27712ad4b0251c1a2ca5df06 (patch) | |
tree | 43a803f08fd4b81493c0f72bcef7727e08d44c1a /odb/pgsql/connection-factory.cxx | |
parent | ece02b4c8cd6f1a332afdb4655b675d1193ed9c2 (diff) |
Detect and mark connection as failed
Diffstat (limited to 'odb/pgsql/connection-factory.cxx')
-rw-r--r-- | odb/pgsql/connection-factory.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/odb/pgsql/connection-factory.cxx b/odb/pgsql/connection-factory.cxx index d725ef0..2154b54 100644 --- a/odb/pgsql/connection-factory.cxx +++ b/odb/pgsql/connection-factory.cxx @@ -126,9 +126,10 @@ namespace odb // Determine if we need to keep or free this connection. // - bool keep (waiters_ != 0 || - min_ == 0 || - (connections_.size () + in_use_ <= min_)); + bool keep (!c->failed () && + (waiters_ != 0 || + min_ == 0 || + (connections_.size () + in_use_ <= min_))); in_use_--; |