aboutsummaryrefslogtreecommitdiff
path: root/common/session/custom/driver.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-01-16 16:31:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-01-16 16:31:29 +0200
commit856a438b33184959b64864f1afdf5a6a2fd6b0d2 (patch)
treeb1fd1d9c616262d8d62e4431469f74e5e74d4fe1 /common/session/custom/driver.cxx
parent5cf30ccfe764701f549e4152ad312187221f5285 (diff)
Make session cache management functions static, add notifications
Diffstat (limited to 'common/session/custom/driver.cxx')
-rw-r--r--common/session/custom/driver.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/common/session/custom/driver.cxx b/common/session/custom/driver.cxx
index 1ec7cbb..0a58ea5 100644
--- a/common/session/custom/driver.cxx
+++ b/common/session/custom/driver.cxx
@@ -145,10 +145,10 @@ main (int argc, char* argv[])
transaction t (db->begin ());
tracer.count = 0;
t.tracer (tracer);
- s.flush (*db); // Flush all the changes.
+ s.flush (*db);
assert (tracer.count == 2);
t.commit ();
- s.mark (); // Mark all the changed objects as unchanged.
+ s.mark ();
}
{
@@ -159,6 +159,22 @@ main (int argc, char* argv[])
assert (tracer.count == 0);
t.commit ();
}
+
+ // Explicit update.
+ //
+ cs->symbol ("CS");
+ st->symbol ("ST");
+
+ {
+ transaction t (db->begin ());
+ db->update (cs);
+ tracer.count = 0;
+ t.tracer (tracer);
+ s.flush (*db);
+ assert (tracer.count == 1);
+ t.commit ();
+ s.mark ();
+ }
}
catch (const odb::exception& e)
{