com.hazelcast.core
Interface Transaction


public interface Transaction

Hazelcast transaction interface.

Note that Hazelcast doesn't support two phase commit (XA) transactions.

See Also:
Hazelcast.getTransaction()

Field Summary
static int TXN_STATUS_ACTIVE
           
static int TXN_STATUS_COMMITTED
           
static int TXN_STATUS_COMMITTING
           
static int TXN_STATUS_NO_TXN
           
static int TXN_STATUS_PREPARED
           
static int TXN_STATUS_PREPARING
           
static int TXN_STATUS_ROLLED_BACK
           
static int TXN_STATUS_ROLLING_BACK
           
static int TXN_STATUS_UNKNOWN
           
 
Method Summary
 void begin()
          Creates a new transaction and associate it with the current thread.
 void commit()
          Commits the transaction associated with the current thread.
 int getStatus()
          Returns the status of the transaction associated with the current thread.
 void rollback()
          Rolls back the transaction associated with the current thread.
 

Field Detail

TXN_STATUS_NO_TXN

static final int TXN_STATUS_NO_TXN
See Also:
Constant Field Values

TXN_STATUS_ACTIVE

static final int TXN_STATUS_ACTIVE
See Also:
Constant Field Values

TXN_STATUS_PREPARED

static final int TXN_STATUS_PREPARED
See Also:
Constant Field Values

TXN_STATUS_COMMITTED

static final int TXN_STATUS_COMMITTED
See Also:
Constant Field Values

TXN_STATUS_ROLLED_BACK

static final int TXN_STATUS_ROLLED_BACK
See Also:
Constant Field Values

TXN_STATUS_PREPARING

static final int TXN_STATUS_PREPARING
See Also:
Constant Field Values

TXN_STATUS_COMMITTING

static final int TXN_STATUS_COMMITTING
See Also:
Constant Field Values

TXN_STATUS_ROLLING_BACK

static final int TXN_STATUS_ROLLING_BACK
See Also:
Constant Field Values

TXN_STATUS_UNKNOWN

static final int TXN_STATUS_UNKNOWN
See Also:
Constant Field Values
Method Detail

begin

void begin()
           throws IllegalStateException
Creates a new transaction and associate it with the current thread.

Throws:
IllegalStateException - if transaction is already began

commit

void commit()
            throws IllegalStateException
Commits the transaction associated with the current thread.

Throws:
IllegalStateException - if transaction didn't begin.

rollback

void rollback()
              throws IllegalStateException
Rolls back the transaction associated with the current thread.

Throws:
IllegalStateException - if transaction didn't begin.

getStatus

int getStatus()
Returns the status of the transaction associated with the current thread.

Returns:
the status


Copyright © 2008-2012 Hazel Ltd. All Rights Reserved.