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
- WebPartMenu.cs
- QilLiteral.cs
- Pen.cs
- IndexedEnumerable.cs
- WebPartActionVerb.cs
- PreApplicationStartMethodAttribute.cs
- RsaSecurityTokenAuthenticator.cs
- SystemKeyConverter.cs
- DropDownButton.cs
- DBCommand.cs
- GridEntry.cs
- DescendantBaseQuery.cs
- CodeIterationStatement.cs
- sqlmetadatafactory.cs
- DataBoundControlAdapter.cs
- WebScriptEndpointElement.cs
- StyleHelper.cs
- HwndPanningFeedback.cs
- OutputCacheSettingsSection.cs
- XmlSchemaAll.cs
- Peer.cs
- WmlPageAdapter.cs
- HttpModuleAction.cs
- MarkupProperty.cs
- AssemblyUtil.cs
- DataServiceHostFactory.cs
- SolidBrush.cs
- invalidudtexception.cs
- PreservationFileWriter.cs
- TextWriterTraceListener.cs
- ThreadStateException.cs
- ControlDesignerState.cs
- OrderPreservingPipeliningMergeHelper.cs
- AnonymousIdentificationSection.cs
- WebServicesDescriptionAttribute.cs
- XmlSchemaElement.cs
- GridViewPageEventArgs.cs
- DataGridViewControlCollection.cs
- ResourceReferenceKeyNotFoundException.cs
- HelpOperationInvoker.cs
- StubHelpers.cs
- Parser.cs
- ConnectionStringsSection.cs
- DataGridViewRowEventArgs.cs
- PinProtectionHelper.cs
- IsolatedStorageFile.cs
- Evidence.cs
- SqlServices.cs
- DirtyTextRange.cs
- FormViewUpdateEventArgs.cs
- InfoCardRequestException.cs
- XmlSchemaProviderAttribute.cs
- IISMapPath.cs
- BinaryParser.cs
- FileLoadException.cs
- Expression.cs
- AuthenticationManager.cs
- BinaryVersion.cs
- CompositeScriptReferenceEventArgs.cs
- FileDetails.cs
- EventProperty.cs
- AxDesigner.cs
- CodeAccessPermission.cs
- MenuTracker.cs
- ValidatingPropertiesEventArgs.cs
- OracleTimeSpan.cs
- arabicshape.cs
- SettingsSection.cs
- Style.cs
- ImpersonateTokenRef.cs
- EditorPart.cs
- PropertyCollection.cs
- FixedTextView.cs
- SoapMessage.cs
- AttributeCallbackBuilder.cs
- StreamGeometry.cs
- DataRowView.cs
- NativeRecognizer.cs
- AuthenticatingEventArgs.cs
- IntegrationExceptionEventArgs.cs
- InstanceStore.cs
- LinkAreaEditor.cs
- JournalEntryStack.cs
- SessionStateItemCollection.cs
- PointF.cs
- HtmlTableRow.cs
- EventLogPermissionEntryCollection.cs
- JsonReader.cs
- ToolBarButtonClickEvent.cs
- HorizontalAlignConverter.cs
- FrameworkElementAutomationPeer.cs
- AvtEvent.cs
- HttpConfigurationContext.cs
- FieldAccessException.cs
- DataGridViewButtonCell.cs
- ExpressionBinding.cs
- PasswordTextNavigator.cs
- StartUpEventArgs.cs
- TranslateTransform.cs
- TrackingValidationObjectDictionary.cs