Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / RunTime / VolatileResourceManager.cs / 1305376 / VolatileResourceManager.cs
#pragma warning disable 1634, 1691 using System; using System.Diagnostics; using System.Transactions; using System.Collections; using System.Collections.Generic; using System.Workflow.Runtime.Hosting; namespace System.Workflow.Runtime { ////// Volatile Resource Manager /// internal sealed class VolatileResourceManager { // members private WorkBatchCollection _workCollection = new WorkBatchCollection(); private WorkBatch _mergedBatch = null; // constructor internal VolatileResourceManager() { } // properties internal WorkBatchCollection BatchCollection { get { return _workCollection; } } internal bool IsBatchDirty { get { IDictionaryEnumerator de = _workCollection.GetEnumerator(); while (de.MoveNext()) { WorkBatch batch = (WorkBatch)de.Value; if (batch.IsDirty) return true; } return false; } } WorkBatch GetMergedBatch() { return this._workCollection.GetMergedBatch(); } 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 Complete() { try { _mergedBatch.Complete(true); } finally { if (_mergedBatch != null) { _mergedBatch.Dispose(); _mergedBatch = null; } if (_workCollection != null) { _workCollection.ClearSubBatches(); } } } 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 ClearAllBatchedWork() { if (_workCollection != null) _workCollection.RollbackAllBatchedWork(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. #pragma warning disable 1634, 1691 using System; using System.Diagnostics; using System.Transactions; using System.Collections; using System.Collections.Generic; using System.Workflow.Runtime.Hosting; namespace System.Workflow.Runtime { ////// Volatile Resource Manager /// internal sealed class VolatileResourceManager { // members private WorkBatchCollection _workCollection = new WorkBatchCollection(); private WorkBatch _mergedBatch = null; // constructor internal VolatileResourceManager() { } // properties internal WorkBatchCollection BatchCollection { get { return _workCollection; } } internal bool IsBatchDirty { get { IDictionaryEnumerator de = _workCollection.GetEnumerator(); while (de.MoveNext()) { WorkBatch batch = (WorkBatch)de.Value; if (batch.IsDirty) return true; } return false; } } WorkBatch GetMergedBatch() { return this._workCollection.GetMergedBatch(); } 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 Complete() { try { _mergedBatch.Complete(true); } finally { if (_mergedBatch != null) { _mergedBatch.Dispose(); _mergedBatch = null; } if (_workCollection != null) { _workCollection.ClearSubBatches(); } } } 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 ClearAllBatchedWork() { if (_workCollection != null) _workCollection.RollbackAllBatchedWork(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PropertySegmentSerializationProvider.cs
- SoapServerProtocol.cs
- Brush.cs
- Stylesheet.cs
- ProtocolReflector.cs
- DataSourceHelper.cs
- RSAOAEPKeyExchangeFormatter.cs
- ControlAdapter.cs
- DataContractSet.cs
- GregorianCalendar.cs
- InfiniteTimeSpanConverter.cs
- CqlBlock.cs
- StringUtil.cs
- HtmlShimManager.cs
- DataViewManager.cs
- ProgressBarAutomationPeer.cs
- RegexCharClass.cs
- StringPropertyBuilder.cs
- TypeConverterHelper.cs
- DataTableReaderListener.cs
- RecommendedAsConfigurableAttribute.cs
- XamlFigureLengthSerializer.cs
- SpeechDetectedEventArgs.cs
- RemotingConfigParser.cs
- OracleDataReader.cs
- CombinedGeometry.cs
- DataContractSerializerServiceBehavior.cs
- XsdDateTime.cs
- Membership.cs
- HyperLink.cs
- DataGridColumnCollection.cs
- TraceContextEventArgs.cs
- ContainerParagraph.cs
- ReferencedType.cs
- RSAOAEPKeyExchangeFormatter.cs
- TripleDESCryptoServiceProvider.cs
- SqlDataSourceQueryEditor.cs
- EdmProperty.cs
- MethodCallConverter.cs
- ClientRuntimeConfig.cs
- Publisher.cs
- DbProviderFactoriesConfigurationHandler.cs
- XmlCharType.cs
- XsltQilFactory.cs
- CommonProperties.cs
- RewritingSimplifier.cs
- DLinqDataModelProvider.cs
- OperationCanceledException.cs
- DoubleAnimationUsingPath.cs
- SerialReceived.cs
- TextBoxAutoCompleteSourceConverter.cs
- SafeNativeMethods.cs
- HwndAppCommandInputProvider.cs
- TextBoxAutomationPeer.cs
- WSDualHttpBindingElement.cs
- TabItem.cs
- RtfFormatStack.cs
- ZoneButton.cs
- TextFormatter.cs
- _LocalDataStoreMgr.cs
- UInt16Storage.cs
- VisualTarget.cs
- SymmetricKeyWrap.cs
- SineEase.cs
- X509Utils.cs
- RouteValueDictionary.cs
- ParallelForEach.cs
- Mappings.cs
- AccessDataSourceView.cs
- JavaScriptObjectDeserializer.cs
- SpeechUI.cs
- SQLInt32.cs
- ActivityInterfaces.cs
- RequestCacheValidator.cs
- SqlRemoveConstantOrderBy.cs
- PropertyMapper.cs
- TimeZone.cs
- CaretElement.cs
- DataGridViewImageCell.cs
- QueryStringParameter.cs
- Formatter.cs
- SafeProcessHandle.cs
- ExpandCollapsePattern.cs
- SiteMapPath.cs
- HTTPRemotingHandler.cs
- ListItemCollection.cs
- BinaryObjectWriter.cs
- ReadOnlyNameValueCollection.cs
- PeerEndPoint.cs
- ExpressionList.cs
- PropertySourceInfo.cs
- SmtpReplyReader.cs
- AttributeCollection.cs
- TemplateColumn.cs
- DataObjectPastingEventArgs.cs
- ListenerSessionConnection.cs
- CheckBoxList.cs
- SchemaDeclBase.cs
- Point3DKeyFrameCollection.cs
- BinaryParser.cs