예제 #1
0
        private void CancelRemoval(Transaction trans, object obj, int index)
        {
            BTreeUpdate patch     = (BTreeUpdate)KeyPatch(index);
            BTreeUpdate nextPatch = patch.RemoveFor(trans);

            _keys[index] = NewCancelledRemoval(trans, patch.GetObject(), obj, nextPatch);
            SizeIncrement(trans);
        }
 public BTreeCancelledRemoval(Transaction transaction, object originalKey, object
                              newKey, BTreeUpdate existingPatches) : base(transaction, originalKey)
 {
     _newKey = newKey;
     if (null != existingPatches)
     {
         Append(existingPatches);
     }
 }
		public BTreeCancelledRemoval(Transaction transaction, object originalKey, object 
			newKey, BTreeUpdate existingPatches) : base(transaction, originalKey)
		{
			_newKey = newKey;
			if (null != existingPatches)
			{
				Append(existingPatches);
			}
		}
예제 #4
0
 public override int SizeDiff(Transaction trans)
 {
     Db4objects.Db4o.Internal.Btree.BTreeUpdate patchForTransaction = (Db4objects.Db4o.Internal.Btree.BTreeUpdate
                                                                       )ForTransaction(trans);
     if (patchForTransaction == null)
     {
         return(1);
     }
     return(patchForTransaction.SizeDiff());
 }
예제 #5
0
 private void SetNextIfPatch(object newNext)
 {
     if (newNext is Db4objects.Db4o.Internal.Btree.BTreeUpdate)
     {
         _next = (Db4objects.Db4o.Internal.Btree.BTreeUpdate)newNext;
     }
     else
     {
         _next = null;
     }
 }
예제 #6
0
 private void SetNextIfPatch(object newNext)
 {
     if (newNext is BTreeUpdate)
     {
         _next = (BTreeUpdate)newNext;
     }
     else
     {
         _next = null;
     }
 }
예제 #7
0
		public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate RemoveFor(Transaction trans
			)
		{
			if (_transaction == trans)
			{
				return _next;
			}
			if (_next != null)
			{
				_next = _next.RemoveFor(trans);
			}
			return this;
		}
예제 #8
0
 public virtual BTreeUpdate RemoveFor(Transaction trans
                                      )
 {
     if (_transaction == trans)
     {
         return(_next);
     }
     if (_next != null)
     {
         _next = _next.RemoveFor(trans);
     }
     return(this);
 }
예제 #9
0
 public virtual BTreeUpdate RemoveFor(Transaction trans
     )
 {
     if (_transaction == trans)
     {
         return _next;
     }
     if (_next != null)
     {
         _next = _next.RemoveFor(trans);
     }
     return this;
 }
예제 #10
0
 public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate RemoveFor(Transaction trans
                                                                     )
 {
     if (_transaction == trans)
     {
         return(_next);
     }
     if (_next != null)
     {
         _next = _next.RemoveFor(trans);
     }
     return(this);
 }
예제 #11
0
 public virtual void Append(Db4objects.Db4o.Internal.Btree.BTreeUpdate patch)
 {
     if (_transaction == patch._transaction)
     {
         throw new ArgumentException();
     }
     if (!HasNext())
     {
         _next = patch;
     }
     else
     {
         _next.Append(patch);
     }
 }
예제 #12
0
 public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate ReplacePatch(BTreePatch
                                                                        patch, Db4objects.Db4o.Internal.Btree.BTreeUpdate update)
 {
     if (patch == this)
     {
         update._next = _next;
         return(update);
     }
     if (_next == null)
     {
         throw new InvalidOperationException();
     }
     _next = _next.ReplacePatch(patch, update);
     return(this);
 }
예제 #13
0
 public virtual BTreeUpdate ReplacePatch(BTreePatch
                                         patch, BTreeUpdate update)
 {
     if (patch == this)
     {
         update._next = _next;
         return(update);
     }
     if (_next == null)
     {
         throw new InvalidOperationException();
     }
     _next = _next.ReplacePatch(patch, update);
     return(this);
 }
예제 #14
0
		public virtual void Append(Db4objects.Db4o.Internal.Btree.BTreeUpdate patch)
		{
			if (_transaction == patch._transaction)
			{
				throw new ArgumentException();
			}
			if (!HasNext())
			{
				_next = patch;
			}
			else
			{
				_next.Append(patch);
			}
		}
예제 #15
0
 public virtual void Append(BTreeUpdate patch)
 {
     if (_transaction == patch._transaction)
     {
         // don't allow two patches for the same transaction
         throw new ArgumentException();
     }
     if (!HasNext())
     {
         _next = patch;
     }
     else
     {
         _next.Append(patch);
     }
 }
예제 #16
0
 public virtual void Append(BTreeUpdate patch)
 {
     if (_transaction == patch._transaction)
     {
         // don't allow two patches for the same transaction
         throw new ArgumentException();
     }
     if (!HasNext())
     {
         _next = patch;
     }
     else
     {
         _next.Append(patch);
     }
 }
예제 #17
0
 public override object Commit(Transaction trans, BTree btree, BTreeNode node)
 {
     Db4objects.Db4o.Internal.Btree.BTreeUpdate patch = (Db4objects.Db4o.Internal.Btree.BTreeUpdate
                                                         )ForTransaction(trans);
     if (patch is BTreeCancelledRemoval)
     {
         object obj = patch.GetCommittedObject();
         ApplyKeyChange(obj);
     }
     else
     {
         if (patch is BTreeRemove)
         {
             RemovedBy(trans, btree, node);
             patch.Committed(btree);
             return(No4.Instance);
         }
     }
     return(InternalCommit(trans, btree));
 }
예제 #18
0
 private BTreePatch NewCancelledRemoval(Transaction trans, object originalObject,
                                        object currentObject, BTreeUpdate existingPatches)
 {
     return(new BTreeCancelledRemoval(trans, originalObject, currentObject, existingPatches
                                      ));
 }
예제 #19
0
		public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate ReplacePatch(BTreePatch
			 patch, Db4objects.Db4o.Internal.Btree.BTreeUpdate update)
		{
			if (patch == this)
			{
				update._next = _next;
				return update;
			}
			if (_next == null)
			{
				throw new InvalidOperationException();
			}
			_next = _next.ReplacePatch(patch, update);
			return this;
		}
예제 #20
0
		private void SetNextIfPatch(object newNext)
		{
			if (newNext is Db4objects.Db4o.Internal.Btree.BTreeUpdate)
			{
				_next = (Db4objects.Db4o.Internal.Btree.BTreeUpdate)newNext;
			}
			else
			{
				_next = null;
			}
		}
예제 #21
0
		private BTreePatch NewCancelledRemoval(Transaction trans, object originalObject, 
			object currentObject, BTreeUpdate existingPatches)
		{
			return new BTreeCancelledRemoval(trans, originalObject, currentObject, existingPatches
				);
		}
예제 #22
0
 public virtual BTreeUpdate ReplacePatch(BTreePatch
     patch, BTreeUpdate update)
 {
     if (patch == this)
     {
         update._next = _next;
         return update;
     }
     if (_next == null)
     {
         throw new InvalidOperationException();
     }
     _next = _next.ReplacePatch(patch, update);
     return this;
 }
예제 #23
0
 private void SetNextIfPatch(object newNext)
 {
     if (newNext is BTreeUpdate)
     {
         _next = (BTreeUpdate) newNext;
     }
     else
     {
         _next = null;
     }
 }