aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/polymorphic-object-statements.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-18 09:32:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-18 09:32:09 +0200
commit1ec822dd7c4d6abc4f1cd42bd398c53fe4897a4a (patch)
treed98c1cdc8f21c9d5c8725bc3937467b603ce1bf3 /odb/mysql/polymorphic-object-statements.hxx
parentaf2808859e7a98666785752b8069c473dda94a1f (diff)
Allocate container traits lazily and only when their definition is seen
This fixes a problem with polymorphic hierarchies spread over multiple files in which case the source code for the derived class does not have the definition of the container traits for the base class. See the comment in the source code for further details.
Diffstat (limited to 'odb/mysql/polymorphic-object-statements.hxx')
-rw-r--r--odb/mysql/polymorphic-object-statements.hxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/odb/mysql/polymorphic-object-statements.hxx b/odb/mysql/polymorphic-object-statements.hxx
index 75b1ae7..748e3ef 100644
--- a/odb/mysql/polymorphic-object-statements.hxx
+++ b/odb/mysql/polymorphic-object-statements.hxx
@@ -348,7 +348,7 @@ namespace odb
container_statement_cache_type&
container_statment_cache ()
{
- return container_statement_cache_;
+ return container_statement_cache_.get (conn_);
}
public:
@@ -380,7 +380,8 @@ namespace odb
root_statements_type& root_statements_;
base_statements_type& base_statements_;
- container_statement_cache_type container_statement_cache_;
+ container_statement_cache_ptr<container_statement_cache_type>
+ container_statement_cache_;
image_type image_;