aboutsummaryrefslogtreecommitdiff
path: root/odb/session.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/session.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/session.hxx')
-rw-r--r--odb/session.hxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/odb/session.hxx b/odb/session.hxx
index 472ea79..3f58a80 100644
--- a/odb/session.hxx
+++ b/odb/session.hxx
@@ -106,6 +106,10 @@ namespace odb
const typename object_traits<T>::pointer_type&);
template <typename T>
+ static void
+ initialize (const position<T>&) {}
+
+ template <typename T>
typename object_traits<T>::pointer_type
find (database_type&, const typename object_traits<T>::id_type&) const;
@@ -114,7 +118,7 @@ namespace odb
erase (database_type&, const typename object_traits<T>::id_type&);
template <typename T>
- void
+ static void
erase (const position<T>&);