Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / tx / System / Transactions / Oletx / OletxCommittableTransaction.cs / 1305376 / OletxCommittableTransaction.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions.Oletx { using System; using System.Configuration; using System.Diagnostics; using System.Runtime.InteropServices; using System.Runtime.Remoting.Messaging; using System.Runtime.Serialization; using System.Security.Permissions; using System.Threading; using System.Transactions.Diagnostics; ////// A Transaction object represents a single transaction. It is created by TransactionManager /// objects through CreateTransaction or UnmarshalTransaction. Alternatively, the static Create /// methodis provided, which creates a "default" TransactionManager and requests that it create /// a new transaction with default values. A transaction can only be committed by /// the client application that created the transaction. If a client application wishes to allow /// access to the transaction by multiple threads, but wants to prevent those other threads from /// committing the transaction, the application can make a "clone" of the transaction. Transaction /// clones have the same capabilities as the original transaction, except for the ability to commit /// the transaction. /// [Serializable] internal class OletxCommittableTransaction : OletxTransaction { bool commitCalled = false; ////// Constructor for the Transaction object. Specifies the TransactionManager instance that is /// creating the transaction. /// /// /// Specifies the TransactionManager instance that is creating the transaction. /// internal OletxCommittableTransaction( RealOletxTransaction realOletxTransaction ) : base( realOletxTransaction ) { realOletxTransaction.committableTransaction = this; } internal bool CommitCalled { get { return this.commitCalled; } } internal void BeginCommit( InternalTransaction internalTransaction ) { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "CommittableTransaction.BeginCommit" ); TransactionCommitCalledTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), this.TransactionTraceId ); } Debug.Assert( ( 0 == this.disposed ), "OletxTransction object is disposed" ); this.realOletxTransaction.InternalTransaction = internalTransaction; this.commitCalled = true; this.realOletxTransaction.Commit(); if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "CommittableTransaction.BeginCommit" ); } return; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Transactions.Oletx { using System; using System.Configuration; using System.Diagnostics; using System.Runtime.InteropServices; using System.Runtime.Remoting.Messaging; using System.Runtime.Serialization; using System.Security.Permissions; using System.Threading; using System.Transactions.Diagnostics; ////// A Transaction object represents a single transaction. It is created by TransactionManager /// objects through CreateTransaction or UnmarshalTransaction. Alternatively, the static Create /// methodis provided, which creates a "default" TransactionManager and requests that it create /// a new transaction with default values. A transaction can only be committed by /// the client application that created the transaction. If a client application wishes to allow /// access to the transaction by multiple threads, but wants to prevent those other threads from /// committing the transaction, the application can make a "clone" of the transaction. Transaction /// clones have the same capabilities as the original transaction, except for the ability to commit /// the transaction. /// [Serializable] internal class OletxCommittableTransaction : OletxTransaction { bool commitCalled = false; ////// Constructor for the Transaction object. Specifies the TransactionManager instance that is /// creating the transaction. /// /// /// Specifies the TransactionManager instance that is creating the transaction. /// internal OletxCommittableTransaction( RealOletxTransaction realOletxTransaction ) : base( realOletxTransaction ) { realOletxTransaction.committableTransaction = this; } internal bool CommitCalled { get { return this.commitCalled; } } internal void BeginCommit( InternalTransaction internalTransaction ) { if ( DiagnosticTrace.Verbose ) { MethodEnteredTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "CommittableTransaction.BeginCommit" ); TransactionCommitCalledTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), this.TransactionTraceId ); } Debug.Assert( ( 0 == this.disposed ), "OletxTransction object is disposed" ); this.realOletxTransaction.InternalTransaction = internalTransaction; this.commitCalled = true; this.realOletxTransaction.Commit(); if ( DiagnosticTrace.Verbose ) { MethodExitedTraceRecord.Trace( SR.GetString( SR.TraceSourceOletx ), "CommittableTransaction.BeginCommit" ); } return; } } } // 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
- GeneratedCodeAttribute.cs
- SqlConnectionPoolProviderInfo.cs
- ImpersonateTokenRef.cs
- FusionWrap.cs
- TextBreakpoint.cs
- QueryExpression.cs
- XmlEntityReference.cs
- Exceptions.cs
- DataGridRow.cs
- SafeRegistryHandle.cs
- PerspectiveCamera.cs
- RunClient.cs
- WpfPayload.cs
- MonthCalendar.cs
- ParseNumbers.cs
- ParserStreamGeometryContext.cs
- LoginCancelEventArgs.cs
- IIS7UserPrincipal.cs
- HostedTransportConfigurationManager.cs
- SqlDataSourceCommandEventArgs.cs
- TabControlCancelEvent.cs
- PackageFilter.cs
- ServiceOperationInvoker.cs
- OrCondition.cs
- ActivityXRefConverter.cs
- SystemIPAddressInformation.cs
- NodeCounter.cs
- ButtonRenderer.cs
- ResourceType.cs
- BitmapScalingModeValidation.cs
- SHA256Managed.cs
- HttpWebRequestElement.cs
- ExceptionUtil.cs
- NetworkCredential.cs
- HealthMonitoringSection.cs
- HebrewNumber.cs
- _DigestClient.cs
- PrintPreviewControl.cs
- SchemaManager.cs
- WebBrowserNavigatingEventHandler.cs
- XslTransform.cs
- BindMarkupExtensionSerializer.cs
- HtmlInputButton.cs
- AudioSignalProblemOccurredEventArgs.cs
- PeerApplicationLaunchInfo.cs
- MergeEnumerator.cs
- CreateCardRequest.cs
- StateRuntime.cs
- ChannelSettingsElement.cs
- DetailsViewPageEventArgs.cs
- VectorConverter.cs
- ToolboxItemAttribute.cs
- SqlConnection.cs
- NavigationFailedEventArgs.cs
- CheckBox.cs
- MenuRendererStandards.cs
- LazyInitializer.cs
- ReflectPropertyDescriptor.cs
- MexNamedPipeBindingElement.cs
- Win32PrintDialog.cs
- ServiceRoute.cs
- Point4DConverter.cs
- TailPinnedEventArgs.cs
- CryptoHandle.cs
- ListViewSortEventArgs.cs
- ZipIORawDataFileBlock.cs
- AnnotationHelper.cs
- InvokeAction.cs
- IRCollection.cs
- EditorZone.cs
- BaseInfoTable.cs
- Tokenizer.cs
- RowToParametersTransformer.cs
- ToolboxComponentsCreatedEventArgs.cs
- AllMembershipCondition.cs
- MatrixConverter.cs
- IBuiltInEvidence.cs
- DesignTimeVisibleAttribute.cs
- InfoCardArgumentException.cs
- XPathAncestorQuery.cs
- DesignerObjectListAdapter.cs
- FilterQueryOptionExpression.cs
- DBSqlParserColumn.cs
- LinqDataSourceStatusEventArgs.cs
- OdbcCommandBuilder.cs
- UnicastIPAddressInformationCollection.cs
- ILGenerator.cs
- MergePropertyDescriptor.cs
- TabItemAutomationPeer.cs
- DataViewListener.cs
- LoginName.cs
- ZipIOCentralDirectoryBlock.cs
- WhiteSpaceTrimStringConverter.cs
- DictionaryCustomTypeDescriptor.cs
- ValidatorCompatibilityHelper.cs
- XamlDesignerSerializationManager.cs
- SafeMarshalContext.cs
- DnsEndPoint.cs
- FloaterParaClient.cs
- LabelLiteral.cs