Ejemplo n.º 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);
			}
		}
Ejemplo n.º 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());
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 6
0
 private void SetNextIfPatch(object newNext)
 {
     if (newNext is BTreeUpdate)
     {
         _next = (BTreeUpdate)newNext;
     }
     else
     {
         _next = null;
     }
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 8
0
 public virtual BTreeUpdate RemoveFor(Transaction trans
                                      )
 {
     if (_transaction == trans)
     {
         return(_next);
     }
     if (_next != null)
     {
         _next = _next.RemoveFor(trans);
     }
     return(this);
 }
Ejemplo n.º 9
0
 public virtual BTreeUpdate RemoveFor(Transaction trans
     )
 {
     if (_transaction == trans)
     {
         return _next;
     }
     if (_next != null)
     {
         _next = _next.RemoveFor(trans);
     }
     return this;
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
			}
		}
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 18
0
 private BTreePatch NewCancelledRemoval(Transaction trans, object originalObject,
                                        object currentObject, BTreeUpdate existingPatches)
 {
     return(new BTreeCancelledRemoval(trans, originalObject, currentObject, existingPatches
                                      ));
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 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;
			}
		}
Ejemplo n.º 21
0
		private BTreePatch NewCancelledRemoval(Transaction trans, object originalObject, 
			object currentObject, BTreeUpdate existingPatches)
		{
			return new BTreeCancelledRemoval(trans, originalObject, currentObject, existingPatches
				);
		}
Ejemplo n.º 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;
 }
Ejemplo n.º 23
0
 private void SetNextIfPatch(object newNext)
 {
     if (newNext is BTreeUpdate)
     {
         _next = (BTreeUpdate) newNext;
     }
     else
     {
         _next = null;
     }
 }