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
- PrivacyNoticeBindingElement.cs
- XmlnsPrefixAttribute.cs
- _SafeNetHandles.cs
- propertyentry.cs
- ValidatingReaderNodeData.cs
- ObjectHandle.cs
- Drawing.cs
- ListViewContainer.cs
- FilterEventArgs.cs
- DataListCommandEventArgs.cs
- Triangle.cs
- OrthographicCamera.cs
- SafeNativeMethods.cs
- CompositeActivityDesigner.cs
- ToolBar.cs
- TokenBasedSetEnumerator.cs
- PartitionResolver.cs
- QueueException.cs
- ConfigsHelper.cs
- DatagridviewDisplayedBandsData.cs
- OperationResponse.cs
- smtpconnection.cs
- IntegerValidatorAttribute.cs
- WindowsListView.cs
- ImportedNamespaceContextItem.cs
- FileDetails.cs
- ObjectStateEntryDbDataRecord.cs
- ExceptionTrace.cs
- TemplateParser.cs
- SqlException.cs
- Base64Stream.cs
- MasterPageCodeDomTreeGenerator.cs
- WebPartDisplayMode.cs
- InplaceBitmapMetadataWriter.cs
- ContainsSearchOperator.cs
- PromptStyle.cs
- ImageUrlEditor.cs
- SemanticResolver.cs
- ProfileProvider.cs
- InvalidPipelineStoreException.cs
- StoragePropertyMapping.cs
- Int64Animation.cs
- HtmlEmptyTagControlBuilder.cs
- ZipPackage.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- BezierSegment.cs
- BindingMAnagerBase.cs
- ContextStaticAttribute.cs
- EncodingDataItem.cs
- BindingNavigatorDesigner.cs
- WaitHandle.cs
- AuthorizationSection.cs
- QueryableDataSourceView.cs
- SqlWebEventProvider.cs
- DataSourceNameHandler.cs
- X509CertificateCollection.cs
- UnitySerializationHolder.cs
- WebConfigurationFileMap.cs
- WebPartActionVerb.cs
- ScriptControlManager.cs
- TextBreakpoint.cs
- SerializationSectionGroup.cs
- SectionVisual.cs
- CharStorage.cs
- XmlElementCollection.cs
- TextEditorLists.cs
- ErrorWebPart.cs
- HtmlInputHidden.cs
- ColorDialog.cs
- HtmlControl.cs
- HtmlInputButton.cs
- ConsumerConnectionPoint.cs
- Page.cs
- MemberExpression.cs
- ApplicationTrust.cs
- VisualTreeUtils.cs
- XmlLoader.cs
- DataGridViewControlCollection.cs
- InputDevice.cs
- ExpressionBinding.cs
- TextViewBase.cs
- AuthenticatingEventArgs.cs
- TransformValueSerializer.cs
- ListItemParagraph.cs
- ImageConverter.cs
- Vector3DCollection.cs
- ClientUtils.cs
- Funcletizer.cs
- WindowCollection.cs
- DiscreteKeyFrames.cs
- AQNBuilder.cs
- DecoderReplacementFallback.cs
- StructuredProperty.cs
- ObjectContext.cs
- CodeConstructor.cs
- XmlSerializerSection.cs
- XmlCharCheckingWriter.cs
- DataGridItem.cs
- EntityDataSourceDesigner.cs
- DbProviderFactoriesConfigurationHandler.cs