Show / Hide Table of Contents

# Interface ITransactions

Transactions facade.

All members are thread-safe and may be used concurrently from multiple threads.

###### Namespace: Apache.Ignite.Core.Transactions

###### Assembly: Apache.Ignite.Core.dll

##### Syntax

    public interface ITransactions

### Properties

#### DefaultTimeout

Gets the default transaction timeout.

##### Declaration

    TimeSpan DefaultTimeout { get; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

#### DefaultTimeoutOnPartitionMapExchange

Gets the default transaction timeout on partition map exchange.

##### Declaration

    TimeSpan DefaultTimeoutOnPartitionMapExchange { get; }

##### Property Value

Type | Description
--- | ---
System.TimeSpan |

#### DefaultTransactionConcurrency

Gets the default transaction concurrency.

##### Declaration

    TransactionConcurrency DefaultTransactionConcurrency { get; }

##### Property Value

Type | Description
--- | ---
TransactionConcurrency |

#### DefaultTransactionIsolation

Gets the default transaction isolation.

##### Declaration

    TransactionIsolation DefaultTransactionIsolation { get; }

##### Property Value

Type | Description
--- | ---
TransactionIsolation |

#### Tx

Gets transaction started by this thread or null if this thread does not have a transaction.

##### Declaration

    ITransaction Tx { get; }

##### Property Value

Type | Description
--- | ---
ITransaction | Transaction started by this thread or null if this thread does not have a transaction.

### Methods

#### GetLocalActiveTransactions()

Returns a list of active transactions initiated by this node.

Returned transactions do not support next operations:

- Commit().
- CommitAsync().
- Get ThreadId.
- Get StartTime.
- Get Meta<TV>(String).
- Get AddMeta<TV>(String, TV).
- Get RemoveMeta<TV>(String).

##### Declaration

    ITransactionCollection GetLocalActiveTransactions()

##### Returns

Type | Description
--- | ---
ITransactionCollection | Collection of ITransactionCollection

#### GetMetrics()

Gets the metrics.

##### Declaration

    ITransactionMetrics GetMetrics()

##### Returns

Type | Description
--- | ---
ITransactionMetrics |

#### ResetMetrics()

Resets the metrics.

##### Declaration

    void ResetMetrics()

#### TxStart()

Starts a transaction with default isolation (DefaultTransactionIsolation, concurrency (DefaultTransactionConcurrency), timeout (DefaultTimeout), and invalidation policy. All defaults are set in CacheConfiguration at startup.

##### Declaration

    ITransaction TxStart()

##### Returns

Type | Description
--- | ---
ITransaction | New transaction.

#### TxStart(TransactionConcurrency, TransactionIsolation)

Starts new transaction with the specified concurrency and isolation.

##### Declaration

    ITransaction TxStart(TransactionConcurrency concurrency, TransactionIsolation isolation)

##### Parameters

Type | Name | Description
--- | --- | ---
TransactionConcurrency | concurrency | Concurrency.
TransactionIsolation | isolation | Isolation.

##### Returns

Type | Description
--- | ---
ITransaction | New transaction.

#### TxStart(TransactionConcurrency, TransactionIsolation, TimeSpan, Int32)

Starts new transaction with the specified concurrency and isolation.

##### Declaration

    ITransaction TxStart(TransactionConcurrency concurrency, TransactionIsolation isolation, TimeSpan timeout, int txSize)

##### Parameters

Type | Name | Description
--- | --- | ---
TransactionConcurrency | concurrency | Concurrency.
TransactionIsolation | isolation | Isolation.
System.TimeSpan | timeout | Timeout. TimeSpan.Zero for indefinite timeout.
System.Int32 | txSize | Number of entries participating in transaction (may be approximate).

##### Returns

Type | Description
--- | ---
ITransaction | New transaction.

#### WithLabel(String)

Returns instance of Ignite Transactions to mark a transaction with a special label.

##### Declaration

    ITransactions WithLabel(string label)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | label |

##### Returns

Type | Description
--- | ---
ITransactions | ITransactions

#### WithTracing()

Returns instance of Ignite Transactions to enable tracing for a transaction.

##### Declaration

    ITransactions WithTracing()

##### Returns

Type | Description
--- | ---
ITransactions | ITransactions