aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/connection-factory.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/pgsql/connection-factory.cxx')
-rw-r--r--odb/pgsql/connection-factory.cxx7
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_--;