From 06e43da76a6173a72b0450e2dadcfa73f6c04964 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 30 Jun 2011 11:33:36 +0200 Subject: Test updating of unmodified object --- common/lifecycle/driver.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/lifecycle/driver.cxx b/common/lifecycle/driver.cxx index 8328700..46d145b 100644 --- a/common/lifecycle/driver.cxx +++ b/common/lifecycle/driver.cxx @@ -28,7 +28,7 @@ main (int argc, char* argv[]) { auto_ptr db (create_database (argc, argv)); - // transient + // Transient. // try { @@ -41,7 +41,7 @@ main (int argc, char* argv[]) { } - // persistent + // Persistent. // { object o (1); @@ -70,7 +70,7 @@ main (int argc, char* argv[]) t.commit (); } - // modified + // Modified. // { transaction t (db->begin ()); @@ -87,7 +87,16 @@ main (int argc, char* argv[]) t.commit (); } - // transient + // Update of unmodified object. + // + { + transaction t (db->begin ()); + auto_ptr o (db->load (1)); + db->update (*o); + t.commit (); + } + + // Transient. // { transaction t (db->begin ()); -- cgit v1.1