Beispiel #1
0
 public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
 {
     if (this._firstTime)
     {
         this._firstTime = false;
         throw new NotImplementedException();
     }
 }
Beispiel #2
0
 public void OnEvent(object sender, CommitEventArgs args)
 {
     var commitEventArgs = args;
     var deletedObjectInfoCollection = commitEventArgs.Deleted.GetEnumerator();
     while (deletedObjectInfoCollection.MoveNext())
     {
         var objectInfo = (IObjectInfo) deletedObjectInfoCollection.Current;
         Assert.AreEqual(itemUUID, objectInfo.GetUUID());
     }
 }
Beispiel #3
0
 public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
 {
     if (!shallListen.value)
     {
         return;
     }
     Assert.IsFalse(gotEvent.value);
     gotEvent.value = true;
     ownEvent.value = ((CommitEventArgs)args).IsOwnCommit();
     lockObject.Run(new _IClosure4_161(lockObject));
 }
 public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
 {
     try
     {
         ((CommitEventArgs)args).ObjectContainer().Query(classConstraint);
     }
     finally
     {
         Lock.Run(new _IClosure4_39(Lock));
     }
 }
Beispiel #5
0
            public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
            {
                CommitEventArgs commitEventArgs             = (CommitEventArgs)args;
                IEnumerator     deletedObjectInfoCollection = commitEventArgs.Deleted.GetEnumerator();

                while (deletedObjectInfoCollection.MoveNext())
                {
                    IObjectInfo objectInfo = (IObjectInfo)deletedObjectInfoCollection.Current;
                    Assert.IsNotNull(objectInfo.GetUUID());
                }
            }
Beispiel #6
0
            public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
            {
                if (!this.IsClassMetadataAvailable())
                {
                    return;
                }
                CommitEventArgs commitEventArgs = (CommitEventArgs)args;
                Transaction     trans           = (Transaction)commitEventArgs.Transaction();

                this.EnsureSingleOccurence(trans, commitEventArgs.Added);
                this.EnsureSingleOccurence(trans, commitEventArgs.Updated);
            }
Beispiel #7
0
            public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
            {
                LocalTransaction trans = (LocalTransaction)((CommitEventArgs)args).Transaction();
                long             transactionTimestamp = trans.Timestamp();
                long             commitTimestamp      = (transactionTimestamp > 0) ? transactionTimestamp : this._enclosing
                                                        ._container.GenerateTimeStampId();
                Transaction sysTrans = trans.SystemTransaction();

                this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Added.GetEnumerator(), commitTimestamp
                                  );
                this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Updated.GetEnumerator(), commitTimestamp
                                  );
                this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Deleted.GetEnumerator(), 0);
            }
Beispiel #8
0
            public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
            {
                if (oc.IsClosed())
                {
                    return;
                }
                IObjectInfoCollection updated = ((CommitEventArgs)args).Updated;
                IEnumerator           infos   = updated.GetEnumerator();

                while (infos.MoveNext())
                {
                    IObjectInfo info = (IObjectInfo)infos.Current;
                    object      obj  = info.GetObject();
                    oc.Refresh(obj, 2);
                }
            }
 public void OnEvent(object sender, CommitEventArgs args)
 {
     if (!shallListen.value)
     {
         return;
     }
     Assert.IsFalse(gotEvent.value);
     gotEvent.value = true;
     ownEvent.value = args.IsOwnCommit();
     lockObject.Run(new _IClosure4_161(lockObject));
 }
 public void OnEvent(object sender, CommitEventArgs args)
 {
     lock (_enclosing._updatesMonitor)
     {
         var trans = ((IInternalObjectContainer) client).Transaction;
         var updated = args.Updated;
         var infos = updated.GetEnumerator();
         while (infos.MoveNext())
         {
             var info = (IObjectInfo) infos.Current;
             var obj = trans.ObjectForIdFromCache((int) info.GetInternalID());
             if (obj == null)
             {
                 continue;
             }
             // DEPTH may need to be 2 for member collections
             // to be updated also.
             client.Refresh(obj, 1);
         }
         if (_enclosing.IsNetworkingCS())
         {
             Runtime.NotifyAll(_enclosing._updatesMonitor);
         }
     }
 }
Beispiel #11
0
 // #example: implement your event handling
 private static void HandleCommitting(object sender,
     CommitEventArgs commitEventArgs)
 {
     // handle the event           
 }
Beispiel #12
0
 public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
 {
     this._enclosing._committed.Increment();
 }
 public void OnEvent(object sender, CommitEventArgs args)
 {
     if (!IsClassMetadataAvailable())
     {
         return;
     }
     var commitEventArgs = args;
     var trans = (Transaction) commitEventArgs.Transaction();
     EnsureSingleOccurence(trans, commitEventArgs.Added);
     EnsureSingleOccurence(trans, commitEventArgs.Updated);
 }
 public void OnEvent(object sender, CommitEventArgs args)
 {
     if (_firstTime)
     {
         _firstTime = false;
         throw new NotImplementedException();
     }
 }
Beispiel #15
0
 public void OnEvent(object sender, CommitEventArgs args)
 {
     var trans = (LocalTransaction) args.Transaction();
     var transactionTimestamp = trans.Timestamp();
     var commitTimestamp = (transactionTimestamp > 0)
         ? transactionTimestamp
         : _enclosing
             ._container.GenerateTimeStampId();
     var sysTrans = trans.SystemTransaction();
     AddTimestamp(sysTrans, args.Added.GetEnumerator(), commitTimestamp
         );
     AddTimestamp(sysTrans, args.Updated.GetEnumerator(), commitTimestamp
         );
     AddTimestamp(sysTrans, args.Deleted.GetEnumerator(), 0);
 }
 public void OnEvent(object sender, CommitEventArgs args)
 {
     if (oc.IsClosed())
     {
         return;
     }
     var updated = args.Updated;
     var infos = updated.GetEnumerator();
     while (infos.MoveNext())
     {
         var info = (IObjectInfo) infos.Current;
         var obj = info.GetObject();
         oc.Refresh(obj, 2);
     }
 }
Beispiel #17
0
 public void OnEvent(object sender, CommitEventArgs args)
 {
     _enclosing._committed.Increment();
 }