From 65ed9ee3ea259432de6e82e89ad24e4b6b399840 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 29 Dec 2015 02:29:04 +0000 Subject: Test a connection is suitably finished before adding back to the pool. --- libdbpp/connectionPool.cpp | 6 ++++++ libdbpp/connectionPool.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/libdbpp/connectionPool.cpp b/libdbpp/connectionPool.cpp index 24a78fa..9dc3a1c 100644 --- a/libdbpp/connectionPool.cpp +++ b/libdbpp/connectionPool.cpp @@ -18,6 +18,12 @@ namespace DB { return factory->create(connectionString); } + void + ConnectionPool::returnTestResource(const Connection * c) const + { + c->finish(); + } + void ConnectionPool::testResource(const Connection * c) const { diff --git a/libdbpp/connectionPool.h b/libdbpp/connectionPool.h index c2ce950..859c269 100644 --- a/libdbpp/connectionPool.h +++ b/libdbpp/connectionPool.h @@ -20,6 +20,8 @@ namespace DB { /// Create a new connection. Connection * createResource() const override; /// Ping a connection. + void returnTestResource(const Connection *) const override; + /// Ping a connection. void testResource(const Connection *) const override; private: -- cgit v1.2.3