aboutsummaryrefslogtreecommitdiff
path: root/odb/no-op-cache-traits.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-01-09 14:50:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-01-16 07:42:54 +0200
commitd2c1f5f1a3063553483d09dec261efa44c6bc9bf (patch)
tree1503cbf2f20c5a2525d3fa0044addac4e8132a53 /odb/no-op-cache-traits.hxx
parent821e1bdf35c6fc208c421fa630ad3f77e841b60e (diff)
Implement two-phase session insertion
On the first step an uninitialized object is inserted into the cache as before (this is necessary to handle recursive loading). The second step is to notify the session that the object has been initialized. On this second step the session can perform change tracking preparations, such as make a copy of the object or reset the modification flag. New test: common/session/custom (implements a custom session that uses copies to track changes).
Diffstat (limited to 'odb/no-op-cache-traits.hxx')
-rw-r--r--odb/no-op-cache-traits.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/odb/no-op-cache-traits.hxx b/odb/no-op-cache-traits.hxx
index 1d9db7c..5600a81 100644
--- a/odb/no-op-cache-traits.hxx
+++ b/odb/no-op-cache-traits.hxx
@@ -128,6 +128,9 @@ namespace odb
static position_type
insert (odb::database&, void*) {return position_type ();}
+ static void
+ initialize (const position_type&) {}
+
static pointer_type
find (odb::database&, const id_type&) {return pointer_type ();}
@@ -151,6 +154,9 @@ namespace odb
//
static position_type
insert (odb::database&, void*) {return position_type ();}
+
+ static void
+ initialize (const position_type&) {}
};
// reference_cache_traits
@@ -188,6 +194,9 @@ namespace odb
static position_type
insert (odb::database&, object_type&) {return position_type ();}
+
+ static void
+ initialize (const position_type&) {}
};
template <typename T>
@@ -198,6 +207,9 @@ namespace odb
static position_type
insert (odb::database&, object_type&) {return position_type ();}
+
+ static void
+ initialize (const position_type&) {}
};
}