diff --git a/include/sqlpp11/connection_pool.h b/include/sqlpp11/connection_pool.h index d81e8c89..72004c80 100644 --- a/include/sqlpp11/connection_pool.h +++ b/include/sqlpp11/connection_pool.h @@ -44,6 +44,8 @@ namespace sqlpp unsigned int maximum_pool_size = 0; std::stack> free_connections; + bool is_connection_compatible(const std::unique_ptr& connection) { + return connection->get_config().get() == this->config.get(); } public: @@ -105,6 +107,7 @@ namespace sqlpp { if (connection.get()) { + if (is_connection_compatible(connection)) { free_connections.push(std::move(connection)); }