aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/connection.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-11-06 18:00:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-11-06 18:00:43 +0200
commit5daaa1a6d9c8f5d3a4ad3d7009df564bc6506424 (patch)
treeb96d205208587208a4e443be192fe264d2f53d57 /odb/mysql/connection.cxx
parent6fd2fb44263eb6704905cddcc607462c21c5e687 (diff)
Add support for container persistence
Generalize statements that were used for persisting objects to work for both objects and containers. Implement a cache for container statements.
Diffstat (limited to 'odb/mysql/connection.cxx')
-rw-r--r--odb/mysql/connection.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/odb/mysql/connection.cxx b/odb/mysql/connection.cxx
index 3c17869..0b38d35 100644
--- a/odb/mysql/connection.cxx
+++ b/odb/mysql/connection.cxx
@@ -3,11 +3,12 @@
// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
-#include <new> // std::bad_alloc
+#include <new> // std::bad_alloc
#include <odb/mysql/database.hxx>
#include <odb/mysql/connection.hxx>
#include <odb/mysql/exceptions.hxx>
+#include <odb/mysql/statement-cache.hxx>
using namespace std;
@@ -17,7 +18,9 @@ namespace odb
{
connection::
connection (database& db)
- : handle_ (&mysql_), active_ (0), statement_cache_ (*this)
+ : handle_ (&mysql_),
+ active_ (0),
+ statement_cache_ (new statement_cache_type (*this))
{
if (mysql_init (handle_) == 0)
throw bad_alloc ();