Source/NFX/ApplicationModel/Volatile/ObjectStoreService.cs
/// <summary>
/// Reverts object state to Normal after the call to Checkout. This way the changes (if any) are not going to be persisted.
/// Returns true if object was found and checkout canceled. Keep in mind: this method CAN NOT revert inner object state
///  to its original state if it was changed, it only unmarks object as changed.
/// This method is reentrant just like the Checkout is
/// </summary>
Reverts object state to Normal after the call to Checkout. This way the changes (if any) are not going to be persisted.
Returns true if object was found and checkout canceled. Keep in mind: this method CAN NOT revert inner object state
to its original state if it was changed, it only unmarks object as changed.
This method is reentrant just like the Checkout is
Reverts object state to Normal after the call to Checkout . This way the changes ( if any ) are not going to be persisted . Returns true if object was found and checkout canceled . Keep in mind : this method CAN NOT revert inner object state to its original state if it was changed it only unmarks object as changed . This method is reentrant just like the Checkout is
public bool UndoCheckout(Guid key)
    {
      if (this.Status != ControlStatus.Active) return false;
      var bucket = getBucket(key);
      ObjectStoreEntry entry = null;
      lock (bucket)
        if (!bucket.TryGetValue(key, out entry)) return false;
      lock (entry)
      {
        if (entry.Status == ObjectStoreEntryStatus.Deleted) return false;
        if (entry.CheckoutCount>0)
           entry.CheckoutCount--;
        if (entry.CheckoutCount==0)
          entry.Status = ObjectStoreEntryStatus.Normal;
        return true;
      }
    }
public bool UndoCheckout ( Guid key ) { if ( this . Status != ControlStatus . Active ) return false ; var bucket = getBucket ( key ) ; ObjectStoreEntry entry = null ; lock ( bucket ) if ( ! bucket . TryGetValue ( key , out entry ) ) return false ; lock ( entry ) { if ( entry . Status == ObjectStoreEntryStatus . Deleted ) return false ; if ( entry . CheckoutCount > 0 ) entry . CheckoutCount -- ; if ( entry . CheckoutCount == 0 ) entry . Status = ObjectStoreEntryStatus . Normal ; return true ; } }
Reverts object state to Normal after the call to Checkout.
Reverts object state to Normal after the call to Checkout .
key
Guid