aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/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
commitd654146abfd45870c9bb0c1a5779d51b0aff2973 (patch)
treec11673177dcaf5f8e6f2584b84415a96461daba8 /odb/pgsql/polymorphic-object-statements.hxx
parent51c80ddaaaa7ddd1bd3708dc36289e322f30939e (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/pgsql/polymorphic-object-statements.hxx')
-rw-r--r--odb/pgsql/polymorphic-object-statements.hxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/odb/pgsql/polymorphic-object-statements.hxx b/odb/pgsql/polymorphic-object-statements.hxx
index 43dd55e..8a85e3c 100644
--- a/odb/pgsql/polymorphic-object-statements.hxx
+++ b/odb/pgsql/polymorphic-object-statements.hxx
@@ -378,7 +378,7 @@ namespace odb
container_statement_cache_type&
container_statment_cache ()
{
- return container_statement_cache_;
+ return container_statement_cache_.get (conn_);
}
public:
@@ -410,7 +410,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_;