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
- PlainXmlWriter.cs
- Attributes.cs
- SettingsPropertyWrongTypeException.cs
- XmlCharCheckingWriter.cs
- PersistChildrenAttribute.cs
- serverconfig.cs
- WebPartEventArgs.cs
- ByteArrayHelperWithString.cs
- SR.cs
- HMAC.cs
- PropertyMappingExceptionEventArgs.cs
- DeleteIndexBinder.cs
- ToolStripScrollButton.cs
- DesignerVerb.cs
- SQLInt64.cs
- BuilderInfo.cs
- Decorator.cs
- IteratorFilter.cs
- DbTransaction.cs
- ListManagerBindingsCollection.cs
- CachedBitmap.cs
- MeshGeometry3D.cs
- URLBuilder.cs
- MultiViewDesigner.cs
- BamlLocalizer.cs
- sitestring.cs
- DataGridViewCellConverter.cs
- PartialClassGenerationTask.cs
- InfoCardSymmetricCrypto.cs
- WmfPlaceableFileHeader.cs
- WebSysDescriptionAttribute.cs
- UnaryExpressionHelper.cs
- CodeCatchClauseCollection.cs
- Shape.cs
- ViewStateChangedEventArgs.cs
- ChannelAcceptor.cs
- safelink.cs
- ToolStripArrowRenderEventArgs.cs
- sqlcontext.cs
- OleDbConnection.cs
- ClientUrlResolverWrapper.cs
- DynamicActivity.cs
- ListViewGroupConverter.cs
- HtmlInputCheckBox.cs
- GridItemPattern.cs
- NullToBooleanConverter.cs
- HttpApplicationFactory.cs
- TriggerActionCollection.cs
- TrailingSpaceComparer.cs
- TextSearch.cs
- SettingsPropertyValue.cs
- UnsafeNativeMethodsPenimc.cs
- PropertyChangedEventManager.cs
- FactoryMaker.cs
- XmlArrayItemAttributes.cs
- DataGrid.cs
- EmptyStringExpandableObjectConverter.cs
- Translator.cs
- EntityType.cs
- nulltextnavigator.cs
- SaveFileDialog.cs
- Application.cs
- Fx.cs
- InputEventArgs.cs
- ObjectListTitleAttribute.cs
- TextSimpleMarkerProperties.cs
- XPathNodeIterator.cs
- PersonalizationState.cs
- XmlILTrace.cs
- SizeFConverter.cs
- ProcessModelSection.cs
- ColorBlend.cs
- ContentIterators.cs
- MoveSizeWinEventHandler.cs
- Error.cs
- XmlHierarchicalEnumerable.cs
- TreeNodeStyleCollection.cs
- PageStatePersister.cs
- XmlUnspecifiedAttribute.cs
- NativeCompoundFileAPIs.cs
- ProxyHwnd.cs
- BamlRecordReader.cs
- TableLayoutStyleCollection.cs
- GenerateHelper.cs
- FileFormatException.cs
- ObjectListDataBindEventArgs.cs
- SafeFileHandle.cs
- TypeExtension.cs
- RightNameExpirationInfoPair.cs
- DisplayMemberTemplateSelector.cs
- XmlSchemaExporter.cs
- SafeHandle.cs
- UnsafeNativeMethods.cs
- TraceRecord.cs
- CodeThrowExceptionStatement.cs
- ISO2022Encoding.cs
- ServiceOperationListItem.cs
- ProgressChangedEventArgs.cs
- UnsafeNativeMethods.cs
- DataGridSortCommandEventArgs.cs