Show / Hide Table of Contents

# Class NetTxTransactionContext

##### Inheritance

System.Object
TransactionContext
NetTxTransactionContext

##### Implements

System.Transactions.ISinglePhaseNotification
System.Transactions.IEnlistmentNotification

##### Inherited Members

TransactionContext.session
TransactionContext.connection
TransactionContext.synchronizations
TransactionContext.InTransaction
TransactionContext.TransactionId
TransactionContext.AddSynchronization(ISynchronization)
TransactionContext.RemoveSynchronization(ISynchronization)
TransactionContext.TransactionStartedListener
TransactionContext.TransactionCommittedListener
TransactionContext.TransactionRolledBackListener
TransactionContext.SignalTransactionStarted()
TransactionContext.SignalTransactionCommitted()
TransactionContext.SignalTransactionRolledBack()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Apache.NMS.ActiveMQ

###### Assembly: Apache.NMS.ActiveMQ.dll

##### Syntax

    public sealed class NetTxTransactionContext : TransactionContext, ISinglePhaseNotification, IEnlistmentNotification

### Constructors

| Improve this Doc View Source

#### NetTxTransactionContext(Session)

##### Declaration

    public NetTxTransactionContext(Session session)

##### Parameters

Type | Name | Description
--- | --- | ---
Session | session |

### Properties

| Improve this Doc View Source

#### DtcWaitHandle

##### Declaration

    public WaitHandle DtcWaitHandle { get; }

##### Property Value

Type | Description
--- | ---
System.Threading.WaitHandle |

| Improve this Doc View Source

#### InLocalTransaction

##### Declaration

    public override bool InLocalTransaction { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

##### Overrides

TransactionContext.InLocalTransaction
| Improve this Doc View Source

#### InNetTransaction

##### Declaration

    public bool InNetTransaction { get; }

##### Property Value

Type | Description
--- | ---
System.Boolean |

| Improve this Doc View Source

#### NetTxState

##### Declaration

    public NetTxTransactionContext.TxState NetTxState { get; }

##### Property Value

Type | Description
--- | ---
NetTxTransactionContext.TxState |

| Improve this Doc View Source

#### SyncRoot

##### Declaration

    public object SyncRoot { get; }

##### Property Value

Type | Description
--- | ---
System.Object |

### Methods

| Improve this Doc View Source

#### Begin()

##### Declaration

    public override void Begin()

##### Overrides

TransactionContext.Begin()
| Improve this Doc View Source

#### Begin(Transaction)

##### Declaration

    public void Begin(Transaction transaction)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Transactions.Transaction | transaction |

| Improve this Doc View Source

#### Commit()

##### Declaration

    public override void Commit()

##### Overrides

TransactionContext.Commit()
| Improve this Doc View Source

#### Commit(Enlistment)

##### Declaration

    public void Commit(Enlistment enlistment)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Transactions.Enlistment | enlistment |

| Improve this Doc View Source

#### InDoubt(Enlistment)

##### Declaration

    public void InDoubt(Enlistment enlistment)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Transactions.Enlistment | enlistment |

| Improve this Doc View Source

#### InitializeDtcTxContext()

Should be called from NetTxSession when created to check if any TX data is stored for recovery and whether the Broker has matching info stored. If an Transaction is found that belongs to this client and is still alive on the Broker it will be recovered, otherwise the stored data should be cleared.

##### Declaration

    public void InitializeDtcTxContext()

| Improve this Doc View Source

#### Prepare(PreparingEnlistment)

##### Declaration

    public void Prepare(PreparingEnlistment preparingEnlistment)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Transactions.PreparingEnlistment | preparingEnlistment |

| Improve this Doc View Source

#### ResetDtcRecovery()

DTC recovery is performed once for each AppDomain per default. In case you want to perform it again during execution of the application you can call this method before. But ensure in this case that no connection is active anymore.

##### Declaration

    public static void ResetDtcRecovery()

| Improve this Doc View Source

#### Rollback()

##### Declaration

    public override void Rollback()

##### Overrides

TransactionContext.Rollback()
| Improve this Doc View Source

#### Rollback(Enlistment)

##### Declaration

    public void Rollback(Enlistment enlistment)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Transactions.Enlistment | enlistment |

| Improve this Doc View Source

#### SinglePhaseCommit(SinglePhaseEnlistment)

##### Declaration

    public void SinglePhaseCommit(SinglePhaseEnlistment enlistment)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Transactions.SinglePhaseEnlistment | enlistment |

### Implements

System.Transactions.ISinglePhaseNotification
System.Transactions.IEnlistmentNotification