Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / DependentTransaction.cs / 1305376 / DependentTransaction.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions { using System; using System.Runtime.Serialization; using System.Transactions.Diagnostics; ///// When we serialize a DependentTransaction, we specify the type OletxTransaction, so a DependentTransaction never // actually gets deserialized. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229:ImplementSerializationConstructors")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2240:ImplementISerializableCorrectly")] [Serializable] public sealed class DependentTransaction : Transaction { bool blocking; // Create a transaction with the given settings // internal DependentTransaction( IsolationLevel isoLevel, InternalTransaction internalTransaction, bool blocking ) : base( isoLevel, internalTransaction ) { this.blocking = blocking; lock( this.internalTransaction ) { if( blocking ) { this.internalTransaction.State.CreateBlockingClone( this.internalTransaction ); } else { this.internalTransaction.State.CreateAbortingClone( this.internalTransaction ); } } } public void Complete() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "DependentTransaction.Complete" ); } lock( this.internalTransaction ) { if( Disposed ) { throw new ObjectDisposedException( "Transaction" ); } if( this.complete ) { throw TransactionException.CreateTransactionCompletedException( SR.GetString( SR.TraceSourceLtm ) ); } this.complete = true; if( blocking ) { this.internalTransaction.State.CompleteBlockingClone( this.internalTransaction ); } else { this.internalTransaction.State.CompleteAbortingClone( this.internalTransaction ); } } if ( DiagnosticTrace.Information ) { DependentCloneCompleteTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.TransactionTraceId ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "DependentTransaction.Complete" ); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions { using System; using System.Runtime.Serialization; using System.Transactions.Diagnostics; ///// When we serialize a DependentTransaction, we specify the type OletxTransaction, so a DependentTransaction never // actually gets deserialized. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2229:ImplementSerializationConstructors")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2240:ImplementISerializableCorrectly")] [Serializable] public sealed class DependentTransaction : Transaction { bool blocking; // Create a transaction with the given settings // internal DependentTransaction( IsolationLevel isoLevel, InternalTransaction internalTransaction, bool blocking ) : base( isoLevel, internalTransaction ) { this.blocking = blocking; lock( this.internalTransaction ) { if( blocking ) { this.internalTransaction.State.CreateBlockingClone( this.internalTransaction ); } else { this.internalTransaction.State.CreateAbortingClone( this.internalTransaction ); } } } public void Complete() { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "DependentTransaction.Complete" ); } lock( this.internalTransaction ) { if( Disposed ) { throw new ObjectDisposedException( "Transaction" ); } if( this.complete ) { throw TransactionException.CreateTransactionCompletedException( SR.GetString( SR.TraceSourceLtm ) ); } this.complete = true; if( blocking ) { this.internalTransaction.State.CompleteBlockingClone( this.internalTransaction ); } else { this.internalTransaction.State.CompleteAbortingClone( this.internalTransaction ); } } if ( DiagnosticTrace.Information ) { DependentCloneCompleteTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), this.TransactionTraceId ); } if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceLtm ), "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
- TakeOrSkipQueryOperator.cs
- ExtractedStateEntry.cs
- ToolStripDropDownMenu.cs
- CodeTypeReferenceSerializer.cs
- storepermissionattribute.cs
- BindingCollectionElement.cs
- FormatVersion.cs
- _ShellExpression.cs
- MetadataCache.cs
- FloatAverageAggregationOperator.cs
- PhysicalFontFamily.cs
- ProfileBuildProvider.cs
- X509CertificateValidator.cs
- CompilerParameters.cs
- PartitionerQueryOperator.cs
- ComponentGuaranteesAttribute.cs
- BatchServiceHost.cs
- HttpRequest.cs
- ListItem.cs
- GraphicsContext.cs
- ClosableStream.cs
- AnnotationHighlightLayer.cs
- RemoteWebConfigurationHostStream.cs
- PackUriHelper.cs
- Merger.cs
- DataContract.cs
- Fonts.cs
- XmlComment.cs
- KnownTypes.cs
- DateTimeUtil.cs
- oledbconnectionstring.cs
- XmlDataSourceNodeDescriptor.cs
- TextRunProperties.cs
- ComponentResourceKeyConverter.cs
- TypeBuilderInstantiation.cs
- FreezableDefaultValueFactory.cs
- ToolStripDropDownItem.cs
- XmlComplianceUtil.cs
- UInt16Storage.cs
- ServiceNameCollection.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- DataGridRow.cs
- ClientScriptManagerWrapper.cs
- ToolStripItemImageRenderEventArgs.cs
- RemoteWebConfigurationHostServer.cs
- UnauthorizedWebPart.cs
- HScrollBar.cs
- ClassHandlersStore.cs
- WebPartTracker.cs
- SqlRemoveConstantOrderBy.cs
- SendSecurityHeaderElement.cs
- ILGenerator.cs
- XamlStream.cs
- X500Name.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- DataReceivedEventArgs.cs
- SqlOuterApplyReducer.cs
- MergeEnumerator.cs
- WorkerRequest.cs
- Paragraph.cs
- BitmapSourceSafeMILHandle.cs
- NamedPipeActivation.cs
- OpenFileDialog.cs
- Token.cs
- DocumentViewerBaseAutomationPeer.cs
- PageRanges.cs
- BigIntegerStorage.cs
- CloudCollection.cs
- CommandValueSerializer.cs
- MessageBox.cs
- Registry.cs
- WebPartConnectionsConnectVerb.cs
- ReferenceCountedObject.cs
- EditingMode.cs
- XmlStreamStore.cs
- WebPartMinimizeVerb.cs
- DriveInfo.cs
- TextTreeUndo.cs
- SynchronizedDispatch.cs
- FormViewUpdateEventArgs.cs
- RegexWorker.cs
- TextRangeEditTables.cs
- PagerStyle.cs
- DateTimeFormatInfo.cs
- HelpInfo.cs
- ValuePattern.cs
- RootCodeDomSerializer.cs
- MD5CryptoServiceProvider.cs
- MissingFieldException.cs
- EditorPartChrome.cs
- FormattedText.cs
- StateMachineSubscription.cs
- ServicePoint.cs
- ListenerServiceInstallComponent.cs
- EncodingTable.cs
- PropertyGroupDescription.cs
- SpeakCompletedEventArgs.cs
- BaseDataListPage.cs
- SharedPersonalizationStateInfo.cs
- DynamicHyperLink.cs