diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-05-27 15:23:10 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-05-27 15:23:10 +0200 |
commit | 88f6ae3ce895a85f47178531cfed3632e5722160 (patch) | |
tree | 0b09d1a7ec0939e25c52c65f166cfc105db98ce8 /odb/pgsql/connection.cxx | |
parent | b2a4611002813c7a89849aefc498eee7221708e3 (diff) |
Add statement-cache and enable relevant functionality in connection
Diffstat (limited to 'odb/pgsql/connection.cxx')
-rw-r--r-- | odb/pgsql/connection.cxx | 47 |
1 files changed, 3 insertions, 44 deletions
diff --git a/odb/pgsql/connection.cxx b/odb/pgsql/connection.cxx index 37f359f..51e09b2 100644 --- a/odb/pgsql/connection.cxx +++ b/odb/pgsql/connection.cxx @@ -10,6 +10,7 @@ #include <odb/pgsql/connection.hxx> #include <odb/pgsql/error.hxx> #include <odb/pgsql/exceptions.hxx> +#include <odb/pgsql/statement-cache.hxx> using namespace std; @@ -20,9 +21,8 @@ namespace odb connection:: connection (database_type& db) : db_ (db), - handle_ (0) - // active_ (0), - // statement_cache_ (new statement_cache_type (*this)) + handle_ (0), + statement_cache_ (new statement_cache_type (*this)) { handle_ = PQconnectdb (db.conninfo ().c_str ()); @@ -40,48 +40,7 @@ namespace odb connection:: ~connection () { - // if (stmt_handles_.size () > 0) - // free_stmt_handles (); - PQfinish (handle_); } - - // void connection:: - // clear_ () - // { - // active_->cancel (); // Should clear itself from active_. - // } - - // MYSQL_STMT* connection:: - // alloc_stmt_handle () - // { - // MYSQL_STMT* stmt (mysql_stmt_init (handle_)); - - // if (stmt == 0) - // throw bad_alloc (); - - // return stmt; - // } - - // void connection:: - // free_stmt_handle (MYSQL_STMT* stmt) - // { - // if (active_ == 0) - // mysql_stmt_close (stmt); - // else - // stmt_handles_.push_back (stmt); - // } - - // void connection:: - // free_stmt_handles () - // { - // for (stmt_handles::iterator i (stmt_handles_.begin ()), - // e (stmt_handles_.end ()); i != e; ++i) - // { - // mysql_stmt_close (*i); - // } - - // stmt_handles_.clear (); - // } } } |