aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/connection.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-12-01 12:09:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-12-01 12:09:07 +0200
commitdce9ac4635ec667a27712ad4b0251c1a2ca5df06 (patch)
tree43a803f08fd4b81493c0f72bcef7727e08d44c1a /odb/pgsql/connection.hxx
parentece02b4c8cd6f1a332afdb4655b675d1193ed9c2 (diff)
Detect and mark connection as failed
Diffstat (limited to 'odb/pgsql/connection.hxx')
-rw-r--r--odb/pgsql/connection.hxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/odb/pgsql/connection.hxx b/odb/pgsql/connection.hxx
index 39d2912..b26e116 100644
--- a/odb/pgsql/connection.hxx
+++ b/odb/pgsql/connection.hxx
@@ -81,6 +81,19 @@ namespace odb
using odb::connection::tracer;
public:
+ bool
+ failed () const
+ {
+ return failed_;
+ }
+
+ void
+ mark_failed ()
+ {
+ failed_ = true;
+ }
+
+ public:
PGconn*
handle ()
{
@@ -108,6 +121,7 @@ namespace odb
database_type& db_;
auto_handle<PGconn> handle_;
+ bool failed_;
// Keep statement_cache_ after handle_ so that it is destroyed before
// the connection is closed.