From dce9ac4635ec667a27712ad4b0251c1a2ca5df06 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 1 Dec 2011 12:09:07 +0200 Subject: Detect and mark connection as failed --- odb/pgsql/connection-factory.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'odb/pgsql/connection-factory.cxx') 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_--; -- cgit v1.1