aboutsummaryrefslogtreecommitdiff
path: root/odb/mssql/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
commitfe625c9b53fa6b251cdc1c7ed5778ccd4dfeefa8 (patch)
treef141d7b69b9f193c7ad97c8dc7b4c3a05cb6d81a /odb/mssql/polymorphic-object-statements.hxx
parent0ab918e8b3660aed2e24d543633da54cf698b72f (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/mssql/polymorphic-object-statements.hxx')
-rw-r--r--odb/mssql/polymorphic-object-statements.hxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/odb/mssql/polymorphic-object-statements.hxx b/odb/mssql/polymorphic-object-statements.hxx
index 0d70ae4..79e9875 100644
--- a/odb/mssql/polymorphic-object-statements.hxx
+++ b/odb/mssql/polymorphic-object-statements.hxx
@@ -336,7 +336,7 @@ namespace odb
container_statement_cache_type&
container_statment_cache ()
{
- return container_statement_cache_;
+ return container_statement_cache_.get (conn_);
}
public:
@@ -368,7 +368,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_;