org.apache.ignite.internal.processors.cache.transactions

## Class IgniteTransactionsImpl<K,V>

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.transactions.IgniteTransactionsImpl<K,V>

All Implemented Interfaces:
  IgniteTransactions, IgniteTransactionsEx

    public class IgniteTransactionsImpl<K,V>
    extends Object
    implements IgniteTransactionsEx

Grid transactions implementation.

### Constructor Summary

Constructors
Constructor and Description
`IgniteTransactionsImpl(GridCacheSharedContext<K,V> cctx)`

### Method Summary

Methods
`TransactionMetrics` `metrics()`
`void` `resetMetrics()` Resets transaction metrics.
`Transaction` `tx()` Gets transaction started by this thread or `null` if this thread does not have a transaction.
`Transaction` `txStart()` Starts transaction with default isolation, concurrency, timeout, and invalidation policy.
`Transaction` `txStart(TransactionConcurrency concurrency, TransactionIsolation isolation)` Starts new transaction with the specified concurrency and isolation.
`Transaction` `txStart(TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize)` Starts transaction with specified isolation, concurrency, timeout, invalidation flag, and number of participating entries.
`IgniteInternalTx` `txStartEx(GridCacheContext ctx, TransactionConcurrency concurrency, TransactionIsolation isolation)`
`IgniteInternalTx` `txStartEx(GridCacheContext ctx, TransactionConcurrency concurrency, TransactionIsolation isolation, long timeout, int txSize)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### IgniteTransactionsImpl

    public IgniteTransactionsImpl(GridCacheSharedContext<K,V> cctx)

Parameters:
  `cctx` - Cache shared context.

### Method Detail

#### txStart

    public Transaction txStart()
                        throws IllegalStateException

Starts transaction with default isolation, concurrency, timeout, and invalidation policy. All defaults are set in `CacheConfiguration` at startup.

Specified by:
  `txStart` in interface `IgniteTransactions`
Returns:
  New transaction
Throws:
  `IllegalStateException` - If transaction is already started by this thread.

#### txStart

    public Transaction txStart(TransactionConcurrency concurrency,
                      TransactionIsolation isolation)

Starts new transaction with the specified concurrency and isolation.

Specified by:
  `txStart` in interface `IgniteTransactions`
Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
Returns:
  New transaction.

#### txStart

    public Transaction txStart(TransactionConcurrency concurrency,
                      TransactionIsolation isolation,
                      long timeout,
                      int txSize)

Starts transaction with specified isolation, concurrency, timeout, invalidation flag, and number of participating entries.

Specified by:
  `txStart` in interface `IgniteTransactions`
Parameters:
  `concurrency` - Concurrency.
  `isolation` - Isolation.
  `timeout` - Timeout.
  `txSize` - Number of entries participating in transaction (may be approximate).
Returns:
  New transaction.

#### txStartEx

    public IgniteInternalTx txStartEx(GridCacheContext ctx,
                             TransactionConcurrency concurrency,
                             TransactionIsolation isolation,
                             long timeout,
                             int txSize)

Specified by:
  `txStartEx` in interface `IgniteTransactionsEx`
Parameters:
  `ctx` - Cache context.
  `concurrency` - Concurrency.
  `isolation` - Isolation.
  `timeout` - Timeout.
  `txSize` - Number of entries participating in transaction (may be approximate).
Returns:
  New transaction.

#### txStartEx

    public IgniteInternalTx txStartEx(GridCacheContext ctx,
                             TransactionConcurrency concurrency,
                             TransactionIsolation isolation)

Specified by:
  `txStartEx` in interface `IgniteTransactionsEx`
Parameters:
  `ctx` - Cache context.
  `concurrency` - Concurrency.
  `isolation` - Isolation.
Returns:
  New transaction.

#### tx

    @Nullable
    public Transaction tx()

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

Specified by:
  `tx` in interface `IgniteTransactions`
Returns:
  Transaction started by this thread or `null` if this thread does not have a transaction.

#### metrics

    public TransactionMetrics metrics()

Specified by:
  `metrics` in interface `IgniteTransactions`
Returns:
  Transaction metrics.

#### resetMetrics

    public void resetMetrics()

Resets transaction metrics.

Specified by:
  `resetMetrics` in interface `IgniteTransactions`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.4.0
Release Date | : September 24 2015