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
- CreateUserErrorEventArgs.cs
- XPathNodeHelper.cs
- TextWriterTraceListener.cs
- VoiceSynthesis.cs
- SwitchAttribute.cs
- EntitySetBase.cs
- FacetDescriptionElement.cs
- ObjectToken.cs
- RangeBase.cs
- RuntimeWrappedException.cs
- DecimalAnimationUsingKeyFrames.cs
- TabControlAutomationPeer.cs
- MetadataCache.cs
- OdbcException.cs
- externdll.cs
- WsatStrings.cs
- ListViewInsertEventArgs.cs
- QueryRewriter.cs
- PTProvider.cs
- httpapplicationstate.cs
- CacheChildrenQuery.cs
- PriorityQueue.cs
- DetailsViewRowCollection.cs
- RepeatButton.cs
- CodeComment.cs
- Trace.cs
- SortedDictionary.cs
- CompModSwitches.cs
- CardSpaceSelector.cs
- DataPagerCommandEventArgs.cs
- BrowserCapabilitiesFactory.cs
- HWStack.cs
- FixedSOMSemanticBox.cs
- WindowInteractionStateTracker.cs
- UTF7Encoding.cs
- NonVisualControlAttribute.cs
- SoapWriter.cs
- DataChangedEventManager.cs
- HttpModulesSection.cs
- FileDataSourceCache.cs
- NamespaceCollection.cs
- ViewEvent.cs
- PtsCache.cs
- DataSourceHelper.cs
- SqlCacheDependencyDatabase.cs
- ClientRolePrincipal.cs
- XmlNamespaceMapping.cs
- PerformanceCounterPermission.cs
- InvalidEnumArgumentException.cs
- DependencyPropertyValueSerializer.cs
- UnknownWrapper.cs
- DbMetaDataColumnNames.cs
- WebServiceFaultDesigner.cs
- ObjectConverter.cs
- MouseGestureConverter.cs
- ISCIIEncoding.cs
- KnownTypes.cs
- EntityDataSource.cs
- Rect3D.cs
- ISAPIWorkerRequest.cs
- SlotInfo.cs
- ErrorRuntimeConfig.cs
- EdmTypeAttribute.cs
- DoubleKeyFrameCollection.cs
- ResXFileRef.cs
- XPathDescendantIterator.cs
- CqlBlock.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- GridSplitterAutomationPeer.cs
- _Semaphore.cs
- EnumerableValidator.cs
- MethodAccessException.cs
- SplitterCancelEvent.cs
- CellCreator.cs
- Vector3dCollection.cs
- ServiceSettingsResponseInfo.cs
- DocumentNUp.cs
- MarkupObject.cs
- ParenthesizePropertyNameAttribute.cs
- WindowsStartMenu.cs
- basecomparevalidator.cs
- TabPage.cs
- ComponentCommands.cs
- TypeBuilderInstantiation.cs
- InvalidEnumArgumentException.cs
- Pts.cs
- CompilerGlobalScopeAttribute.cs
- SpecialNameAttribute.cs
- FixedPageProcessor.cs
- DataSourceControl.cs
- TemplateFactory.cs
- DataGridViewAdvancedBorderStyle.cs
- ThicknessAnimation.cs
- TransformerTypeCollection.cs
- MinMaxParagraphWidth.cs
- CaseInsensitiveComparer.cs
- AliasedSlot.cs
- Cursors.cs
- AuthorizationSection.cs
- Facet.cs