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
- _SingleItemRequestCache.cs
- TransformerConfigurationWizardBase.cs
- MailBnfHelper.cs
- TraceListener.cs
- GridViewEditEventArgs.cs
- HealthMonitoringSection.cs
- TdsRecordBufferSetter.cs
- EntityCollection.cs
- TemplateField.cs
- CacheOutputQuery.cs
- BitmapImage.cs
- HashCryptoHandle.cs
- OrderByLifter.cs
- Section.cs
- SqlWorkflowPersistenceService.cs
- TreePrinter.cs
- TypeDelegator.cs
- QilReplaceVisitor.cs
- ReflectionUtil.cs
- ToolStripContentPanelRenderEventArgs.cs
- InkCollectionBehavior.cs
- AsyncDataRequest.cs
- followingsibling.cs
- DBSchemaRow.cs
- HostingEnvironment.cs
- BamlWriter.cs
- Rectangle.cs
- FormsAuthenticationUser.cs
- PauseStoryboard.cs
- printdlgexmarshaler.cs
- Console.cs
- SchemaObjectWriter.cs
- ClientRuntimeConfig.cs
- SqlDataReaderSmi.cs
- UnsafeNativeMethods.cs
- PolicyManager.cs
- unsafeIndexingFilterStream.cs
- CompoundFileDeflateTransform.cs
- SoapElementAttribute.cs
- FormViewActionList.cs
- _NegoStream.cs
- Helpers.cs
- VisualTreeHelper.cs
- WebPartVerb.cs
- LinqDataSourceContextData.cs
- Rule.cs
- GatewayDefinition.cs
- TypeDescriptionProviderAttribute.cs
- TextFindEngine.cs
- RowBinding.cs
- XmlSchemaSimpleContentExtension.cs
- ServiceModelConfigurationSectionGroup.cs
- sqlstateclientmanager.cs
- SharedPersonalizationStateInfo.cs
- CommandID.cs
- PropertyMetadata.cs
- HttpClientCertificate.cs
- ActivityWithResultValueSerializer.cs
- XmlDataDocument.cs
- querybuilder.cs
- CancelEventArgs.cs
- GatewayIPAddressInformationCollection.cs
- SQLGuidStorage.cs
- RawContentTypeMapper.cs
- SynchronousChannelMergeEnumerator.cs
- PaginationProgressEventArgs.cs
- IriParsingElement.cs
- ChooseAction.cs
- DataServiceRequestException.cs
- HttpCachePolicy.cs
- ImageBrush.cs
- Helper.cs
- TreeNodeCollection.cs
- TogglePatternIdentifiers.cs
- AxisAngleRotation3D.cs
- ToolStripPanelRow.cs
- ColumnHeader.cs
- WebBrowser.cs
- RtType.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- RawTextInputReport.cs
- ToolStripDropDownClosedEventArgs.cs
- ToolStripArrowRenderEventArgs.cs
- Timer.cs
- NamespaceInfo.cs
- QuerySelectOp.cs
- HtmlLink.cs
- ProfileSettings.cs
- CommonGetThemePartSize.cs
- NamespaceList.cs
- SafeProcessHandle.cs
- HotSpot.cs
- BindableAttribute.cs
- RenderOptions.cs
- Substitution.cs
- M3DUtil.cs
- UndirectedGraph.cs
- XmlTextReader.cs
- CollectionExtensions.cs
- BufferBuilder.cs