예제 #1
0
 /// <exception cref="System.Exception"></exception>
 public virtual void TestTransactionConsistentVersion()
 {
     Store(new VersionNumbersTestCase.Item(Newer));
     Db().Commit();
     VersionNumbersTestCase.Item newer    = ItemByName(Newer);
     VersionNumbersTestCase.Item original = ItemByName(Original);
     Assert.IsGreater(Version(original), Version(newer));
     newer._name    += " modified";
     original._name += " modified";
     Store(newer);
     Store(original);
     Db().Commit();
     Assert.AreEqual(Version(newer), Version(original));
     Reopen();
     newer    = ItemByName(newer._name);
     original = ItemByName(original._name);
     Assert.AreEqual(Version(newer), Version(original));
 }
예제 #2
0
        public virtual void TestVersionIncrease()
        {
            VersionNumbersTestCase.Item item = (VersionNumbersTestCase.Item)((VersionNumbersTestCase.Item
                                                                              )RetrieveOnlyInstance(typeof(VersionNumbersTestCase.Item)));
            IObjectInfo objectInfo = Db().GetObjectInfo(item);
            long        version1   = objectInfo.GetCommitTimestamp();

            item._name = "modified";
            Db().Store(item);
            Db().Commit();
            long version2 = objectInfo.GetCommitTimestamp();

            Assert.IsGreater(version1, version2);
            Db().Store(item);
            Db().Commit();
            objectInfo = Db().GetObjectInfo(item);
            long version3 = objectInfo.GetCommitTimestamp();

            Assert.IsGreater(version2, version3);
        }