org.apache.ignite.configuration

## Class TransactionConfiguration

- java.lang.Object
- - org.apache.ignite.configuration.TransactionConfiguration

All Implemented Interfaces:
  Serializable

    public class TransactionConfiguration
    extends Object
    implements Serializable

Transactions configuration.

See Also:
  Serialized Form

### Field Summary

Fields
`static int` `DFLT_PESSIMISTIC_TX_LOG_LINGER` Default size of pessimistic transactions log.
`static long` `DFLT_TRANSACTION_TIMEOUT` Default transaction timeout.
`static TransactionConcurrency` `DFLT_TX_CONCURRENCY` Default concurrency mode.
`static TransactionIsolation` `DFLT_TX_ISOLATION` Default transaction isolation level.
`static boolean` `DFLT_TX_SERIALIZABLE_ENABLED` Default value for 'txSerializableEnabled' flag.

### Constructor Summary

Constructors
Constructor and Description
`TransactionConfiguration()` Empty constructor.
`TransactionConfiguration(TransactionConfiguration cfg)`

### Method Summary

Methods
`TransactionConcurrency` `getDefaultTxConcurrency()` Default cache transaction concurrency to use when one is not explicitly specified.
`TransactionIsolation` `getDefaultTxIsolation()` Default cache transaction isolation to use when one is not explicitly specified.
`long` `getDefaultTxTimeout()` Gets default transaction timeout.
`int` `getPessimisticTxLogLinger()` Gets delay, in milliseconds, after which pessimistic recovery entries will be cleaned up for failed node.
`int` `getPessimisticTxLogSize()` Gets size of pessimistic transactions log stored on node in order to recover transaction commit if originating node has left grid before it has sent all messages to transaction nodes.
`boolean` `isTxSerializableEnabled()` Gets flag to enable/disable `TransactionIsolation.SERIALIZABLE` isolation level for cache transactions.
`void` `setDefaultTxConcurrency(TransactionConcurrency dfltConcurrency)` Sets default transaction concurrency.
`void` `setDefaultTxIsolation(TransactionIsolation dfltIsolation)` Sets default transaction isolation.
`void` `setDefaultTxTimeout(long dfltTxTimeout)` Sets default transaction timeout in milliseconds.
`void` `setPessimisticTxLogLinger(int pessimisticTxLogLinger)` Sets cleanup delay for pessimistic transaction recovery log for failed node, in milliseconds.
`void` `setPessimisticTxLogSize(int pessimisticTxLogSize)` Sets pessimistic transactions log size.
`void` `setTxSerializableEnabled(boolean txSerEnabled)` Enables/disables serializable cache transactions.

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

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

### Field Detail

#### DFLT_TX_SERIALIZABLE_ENABLED

    public static final boolean DFLT_TX_SERIALIZABLE_ENABLED

Default value for 'txSerializableEnabled' flag.

See Also:
  Constant Field Values

#### DFLT_TX_CONCURRENCY

    public static final TransactionConcurrency DFLT_TX_CONCURRENCY

Default concurrency mode.

#### DFLT_TX_ISOLATION

    public static final TransactionIsolation DFLT_TX_ISOLATION

Default transaction isolation level.

#### DFLT_TRANSACTION_TIMEOUT

    public static final long DFLT_TRANSACTION_TIMEOUT

Default transaction timeout.

See Also:
  Constant Field Values

#### DFLT_PESSIMISTIC_TX_LOG_LINGER

    public static final int DFLT_PESSIMISTIC_TX_LOG_LINGER

Default size of pessimistic transactions log.

See Also:
  Constant Field Values

### Constructor Detail

#### TransactionConfiguration

    public TransactionConfiguration()

Empty constructor.

#### TransactionConfiguration

    public TransactionConfiguration(TransactionConfiguration cfg)

Parameters:
  `cfg` - Configuration to copy.

### Method Detail

#### isTxSerializableEnabled

    public boolean isTxSerializableEnabled()

Gets flag to enable/disable `TransactionIsolation.SERIALIZABLE` isolation level for cache transactions. Serializable level does carry certain overhead and if not used, should be disabled. Default value is `false`.

Returns:
  `True` if serializable transactions are enabled, `false` otherwise.

#### setTxSerializableEnabled

    public void setTxSerializableEnabled(boolean txSerEnabled)

Enables/disables serializable cache transactions. See `isTxSerializableEnabled()` for more information.

Parameters:
  `txSerEnabled` - Flag to enable/disable serializable cache transactions.

#### getDefaultTxConcurrency

    public TransactionConcurrency getDefaultTxConcurrency()

Default cache transaction concurrency to use when one is not explicitly specified. Default value is defined by `DFLT_TX_CONCURRENCY`.

Returns:
  Default cache transaction concurrency.
See Also:
  `Transaction`

#### setDefaultTxConcurrency

    public void setDefaultTxConcurrency(TransactionConcurrency dfltConcurrency)

Sets default transaction concurrency.

Parameters:
  `dfltConcurrency` - Default cache transaction concurrency.

#### getDefaultTxIsolation

    public TransactionIsolation getDefaultTxIsolation()

Default cache transaction isolation to use when one is not explicitly specified. Default value is defined by `DFLT_TX_ISOLATION`.

Returns:
  Default cache transaction isolation.
See Also:
  `Transaction`

#### setDefaultTxIsolation

    public void setDefaultTxIsolation(TransactionIsolation dfltIsolation)

Sets default transaction isolation.

Parameters:
  `dfltIsolation` - Default cache transaction isolation.

#### getDefaultTxTimeout

    public long getDefaultTxTimeout()

Gets default transaction timeout. Default value is defined by `DFLT_TRANSACTION_TIMEOUT` which is `0` and means that transactions will never time out.

Returns:
  Default transaction timeout.

#### setDefaultTxTimeout

    public void setDefaultTxTimeout(long dfltTxTimeout)

Sets default transaction timeout in milliseconds. By default this value is defined by `DFLT_TRANSACTION_TIMEOUT`.

Parameters:
  `dfltTxTimeout` - Default transaction timeout.

#### getPessimisticTxLogSize

    public int getPessimisticTxLogSize()

Gets size of pessimistic transactions log stored on node in order to recover transaction commit if originating node has left grid before it has sent all messages to transaction nodes.

If not set, default value is `0` which means unlimited log size.

Returns:
  Pessimistic transaction log size.

#### setPessimisticTxLogSize

    public void setPessimisticTxLogSize(int pessimisticTxLogSize)

Sets pessimistic transactions log size.

Parameters:
  `pessimisticTxLogSize` - Pessimistic transactions log size.
See Also:
  `getPessimisticTxLogSize()`

#### getPessimisticTxLogLinger

    public int getPessimisticTxLogLinger()

Gets delay, in milliseconds, after which pessimistic recovery entries will be cleaned up for failed node.

If not set, default value is `DFLT_PESSIMISTIC_TX_LOG_LINGER`.

Returns:
  Pessimistic log cleanup delay in milliseconds.

#### setPessimisticTxLogLinger

    public void setPessimisticTxLogLinger(int pessimisticTxLogLinger)

Sets cleanup delay for pessimistic transaction recovery log for failed node, in milliseconds.

Parameters:
  `pessimisticTxLogLinger` - Pessimistic log cleanup delay.
See Also:
  `getPessimisticTxLogLinger()`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015