/// <summary>
        /// API for Runtime to call to do Merge Operation: Right now
        /// we dont use this because we dont support incoming work collection.
        /// </summary>
        /// <param name="batch"></param>
        internal void Merge(WorkBatch batch)
        {
            if (batch == null)
            {
                return; //nothing to merge
            }
            if (_pendingWorkCollection == null)
            {
                throw new ObjectDisposedException("WorkBatch");
            }

            lock (this.mutex)
            {
                lock (batch.mutex)
                {
                    foreach (KeyValuePair <IPendingWork, SortedList <long, object> > item in batch._pendingWorkCollection.WorkItems)
                    {
                        //_pendingWorkCollection.AddRange(item.Key, item.Value);
                        SortedList <long, object> newItems = item.Value;
                        foreach (KeyValuePair <long, object> kvp in newItems)
                        {
                            _pendingWorkCollection.Add(item.Key, kvp.Key, kvp.Value);
                        }
                    }
                }

                this._state = WorkBatchState.Merged;
            }
        }
 internal void Commit()
 {
     this._mergedBatch = this.GetMergedBatch();
     Transaction current = Transaction.Current;
     if (null == current)
     {
         throw new InvalidOperationException(ExecutionStringManager.NullAmbientTransaction);
     }
     this._mergedBatch.Commit(current);
 }
        internal void Commit()
        {
            this._mergedBatch = this.GetMergedBatch();
            Transaction current = Transaction.Current;

            if (null == current)
            {
                throw new InvalidOperationException(ExecutionStringManager.NullAmbientTransaction);
            }
            this._mergedBatch.Commit(current);
        }
        internal void Commit()
        {
            _mergedBatch = GetMergedBatch();

            Transaction transaction = Transaction.Current;
            if (null == transaction)
                throw new InvalidOperationException(ExecutionStringManager.NullAmbientTransaction);

            // Do Commit Sequence iteration over work collection
            _mergedBatch.Commit(transaction);
        }
 internal void HandleFault()
 {
     if (this._mergedBatch != null)
     {
         this._mergedBatch.Dispose();
         this._mergedBatch = null;
     }
     if (this._workCollection != null)
     {
         this._workCollection.ClearTransientBatch();
     }
 }
 internal void HandleFault()
 {
     if (this._mergedBatch != null)
     {
         this._mergedBatch.Dispose();
         this._mergedBatch = null;
     }
     if (this._workCollection != null)
     {
         this._workCollection.ClearTransientBatch();
     }
 }
示例#7
0
        internal void Commit()
        {
            _mergedBatch = GetMergedBatch();

            Transaction transaction = Transaction.Current;

            if (null == transaction)
            {
                throw new InvalidOperationException(ExecutionStringManager.NullAmbientTransaction);
            }

            // Do Commit Sequence iteration over work collection
            _mergedBatch.Commit(transaction);
        }
示例#8
0
 internal void HandleFault()
 {
     //
     // We've failed, clear the merged batch
     if (_mergedBatch != null)
     {
         _mergedBatch.Dispose();
         _mergedBatch = null;
     }
     // clear transient batch which holds instance state primarily
     if (_workCollection != null)
     {
         _workCollection.ClearTransientBatch();
     }
 }
 internal void Complete()
 {
     try
     {
         this._mergedBatch.Complete(true);
     }
     finally
     {
         if (this._mergedBatch != null)
         {
             this._mergedBatch.Dispose();
             this._mergedBatch = null;
         }
         if (this._workCollection != null)
         {
             this._workCollection.ClearSubBatches();
         }
     }
 }
 internal void Complete()
 {
     try
     {
         _mergedBatch.Complete(true);
     }
     finally
     {
         if (_mergedBatch != null)
         {
             _mergedBatch.Dispose();
             _mergedBatch = null;
         }
         if (_workCollection != null)
         {
             _workCollection.ClearSubBatches();
         }
     }
 }
示例#11
0
 internal void Merge(WorkBatch batch)
 {
     if (batch != null)
     {
         if (this._pendingWorkCollection == null)
         {
             throw new ObjectDisposedException("WorkBatch");
         }
         lock (this.mutex)
         {
             lock (batch.mutex)
             {
                 foreach (KeyValuePair <IPendingWork, SortedList <long, object> > pair in batch._pendingWorkCollection.WorkItems)
                 {
                     foreach (KeyValuePair <long, object> pair2 in pair.Value)
                     {
                         this._pendingWorkCollection.Add(pair.Key, pair2.Key, pair2.Value);
                     }
                 }
             }
             this._state = WorkBatchState.Merged;
         }
     }
 }
 internal void Merge(WorkBatch batch)
 {
     if (batch != null)
     {
         if (this._pendingWorkCollection == null)
         {
             throw new ObjectDisposedException("WorkBatch");
         }
         lock (this.mutex)
         {
             lock (batch.mutex)
             {
                 foreach (KeyValuePair<IPendingWork, SortedList<long, object>> pair in batch._pendingWorkCollection.WorkItems)
                 {
                     foreach (KeyValuePair<long, object> pair2 in pair.Value)
                     {
                         this._pendingWorkCollection.Add(pair.Key, pair2.Key, pair2.Value);
                     }
                 }
             }
             this._state = WorkBatchState.Merged;
         }
     }
 }
 internal void HandleFault()
 {
     //
     // We've failed, clear the merged batch
     if (_mergedBatch != null)
     {
         _mergedBatch.Dispose();
         _mergedBatch = null;
     }
     // clear transient batch which holds instance state primarily
     if (_workCollection != null)
     {
         _workCollection.ClearTransientBatch();
     }
 }