aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-06-30 11:33:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-06-30 11:33:36 +0200
commit06e43da76a6173a72b0450e2dadcfa73f6c04964 (patch)
tree7dceab0992e53fd3f95aa3cf9bbe97bcf41fde35
parentf8b4329205ff7a1b965ce35e99a7943d9a82f5d4 (diff)
Test updating of unmodified object
-rw-r--r--common/lifecycle/driver.cxx17
1 files changed, 13 insertions, 4 deletions
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<database> 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<object> o (db->load<object> (1));
+ db->update (*o);
+ t.commit ();
+ }
+
+ // Transient.
//
{
transaction t (db->begin ());