Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / Oletx / OletxDependentTransaction.cs / 1305376 / OletxDependentTransaction.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Diagnostics; using System.Threading; using System.Transactions.Diagnostics; namespace System.Transactions.Oletx { [Serializable] internal class OletxDependentTransaction : OletxTransaction { private OletxVolatileEnlistmentContainer volatileEnlistmentContainer; private int completed = 0; internal OletxDependentTransaction( RealOletxTransaction realTransaction, bool delayCommit ) : base( realTransaction ) { if ( null == realTransaction ) { throw new ArgumentNullException( "realTransaction" ); } this.volatileEnlistmentContainer = realOletxTransaction.AddDependentClone( delayCommit ); if ( DiagnosticTrace.Information ) { DependentCloneCreatedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), this.TransactionTraceId, delayCommit ? DependentCloneOption.BlockCommitUntilComplete : DependentCloneOption.RollbackIfNotComplete ); } } public void Complete() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "DependentTransaction.Complete" ); } Debug.Assert( ( 0 == this.disposed ), "OletxTransction object is disposed" ); int localCompleted = Interlocked.CompareExchange( ref this.completed, 1, 0 ); if ( 1 == localCompleted ) { throw TransactionException.CreateTransactionCompletedException( SR.GetString( SR.TraceSourceOletx ) ); } if ( DiagnosticTrace.Information ) { DependentCloneCompleteTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), this.TransactionTraceId ); } this.volatileEnlistmentContainer.DependentCloneCompleted(); if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "DependentTransaction.Complete" ); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Diagnostics; using System.Threading; using System.Transactions.Diagnostics; namespace System.Transactions.Oletx { [Serializable] internal class OletxDependentTransaction : OletxTransaction { private OletxVolatileEnlistmentContainer volatileEnlistmentContainer; private int completed = 0; internal OletxDependentTransaction( RealOletxTransaction realTransaction, bool delayCommit ) : base( realTransaction ) { if ( null == realTransaction ) { throw new ArgumentNullException( "realTransaction" ); } this.volatileEnlistmentContainer = realOletxTransaction.AddDependentClone( delayCommit ); if ( DiagnosticTrace.Information ) { DependentCloneCreatedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), this.TransactionTraceId, delayCommit ? DependentCloneOption.BlockCommitUntilComplete : DependentCloneOption.RollbackIfNotComplete ); } } public void Complete() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "DependentTransaction.Complete" ); } Debug.Assert( ( 0 == this.disposed ), "OletxTransction object is disposed" ); int localCompleted = Interlocked.CompareExchange( ref this.completed, 1, 0 ); if ( 1 == localCompleted ) { throw TransactionException.CreateTransactionCompletedException( SR.GetString( SR.TraceSourceOletx ) ); } if ( DiagnosticTrace.Information ) { DependentCloneCompleteTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), this.TransactionTraceId ); } this.volatileEnlistmentContainer.DependentCloneCompleted(); if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "DependentTransaction.Complete" ); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MessagePartDescription.cs
- ReachDocumentReferenceSerializer.cs
- StaticFileHandler.cs
- DbMetaDataFactory.cs
- WebServiceAttribute.cs
- Size3D.cs
- SnapshotChangeTrackingStrategy.cs
- MembershipSection.cs
- CryptoHandle.cs
- GridViewColumnCollectionChangedEventArgs.cs
- ActiveXSite.cs
- GroupBox.cs
- AuthenticationModulesSection.cs
- ISO2022Encoding.cs
- ClientRolePrincipal.cs
- Application.cs
- Drawing.cs
- Exceptions.cs
- _SslState.cs
- ParameterBinding.cs
- Vars.cs
- AdornerHitTestResult.cs
- HotCommands.cs
- XMLUtil.cs
- DataObjectSettingDataEventArgs.cs
- SequenceFullException.cs
- UnauthorizedWebPart.cs
- TreeNodeMouseHoverEvent.cs
- Animatable.cs
- Int64AnimationUsingKeyFrames.cs
- MetadataWorkspace.cs
- EntityProviderFactory.cs
- DoubleAnimation.cs
- Geometry3D.cs
- WebScriptMetadataMessageEncoderFactory.cs
- ListViewInsertEventArgs.cs
- ImageListStreamer.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- ListViewGroupItemCollection.cs
- ZoomPercentageConverter.cs
- _StreamFramer.cs
- CodeDelegateCreateExpression.cs
- BlurBitmapEffect.cs
- ControlValuePropertyAttribute.cs
- RootBrowserWindowAutomationPeer.cs
- MetadataException.cs
- GlyphRun.cs
- SerializerProvider.cs
- RawTextInputReport.cs
- ProcessModelSection.cs
- DaylightTime.cs
- SettingsPropertyWrongTypeException.cs
- BuildResultCache.cs
- ColorBuilder.cs
- DataGridRowAutomationPeer.cs
- Point.cs
- VisualTreeUtils.cs
- VirtualizedItemProviderWrapper.cs
- DataGridViewRowEventArgs.cs
- SettingsSection.cs
- ValidationRuleCollection.cs
- ContextMenu.cs
- Utils.cs
- CompensationHandlingFilter.cs
- BackoffTimeoutHelper.cs
- Canvas.cs
- VersionValidator.cs
- SqlCacheDependency.cs
- ValidationHelper.cs
- ConsumerConnectionPointCollection.cs
- ConnectionManagementSection.cs
- ByteStack.cs
- Size3DConverter.cs
- MembershipPasswordException.cs
- ClientConfigurationSystem.cs
- SoapCommonClasses.cs
- Authorization.cs
- XmlRawWriterWrapper.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- NativeMethods.cs
- CompositeTypefaceMetrics.cs
- ScrollChrome.cs
- EdgeProfileValidation.cs
- FormatConvertedBitmap.cs
- NullRuntimeConfig.cs
- DataShape.cs
- System.Data_BID.cs
- MethodToken.cs
- DataControlLinkButton.cs
- ResourceDictionaryCollection.cs
- ListItemCollection.cs
- SafeLibraryHandle.cs
- XamlFxTrace.cs
- ProcessHost.cs
- WebUtil.cs
- WebExceptionStatus.cs
- CodeBlockBuilder.cs
- XmlSortKey.cs
- NameValueConfigurationElement.cs
- RelationshipNavigation.cs