com.cloudtran.api
Interface CTxDefinition

All Known Implementing Classes:
DefaultCTxDefinition

public interface CTxDefinition

This is the information the programmer supplies to define a transaction to CloudTran. See DefaultCTxDefinition for detailed documentation of the fields.


Field Summary
static int DEFAULT_COHORT_TRANSACTION_HEARTBEAT_PERIOD
          This is only used in CloudTran for GigaSpaces.
static int DEFAULT_TRANSACTION_TIMEOUT
          This is the default transaction timeout for this CloudTran run, in seconds.
static short TX_TYPE_COH_LLAPI_MVCC
          Defines the type of transaction to be Coherence / Low-level API / MVCC
static short TX_TYPE_COH_LLAPI_PL
          Defines the type of transaction to be Coherence / Low-level API / Pessimistic Locking
static short TX_TYPE_COH_TLG
          Defines the type of transaction to be Coherence / TopLink Grid
static short TX_TYPE_GS
          GigaSpaces transaction
static short UPDATECHECK_NONE
          In LLAPI/MVCC transactions, no checks are made on the update.
static short UPDATECHECK_READWRITE
          In LLAPI/MVCC transactions, this policy prevents read-write conflicts (aka 'write-skew' conflicts).
static short UPDATECHECK_WRITE
          In LLAPI/MVCC transactions, this policy prevents write conflicts.
 
Method Summary
 CTxDefinition getClone()
           
 int getCohortTransactionHearbeatPeriod()
           
 String getIds()
           
 long getInternalTxId()
           
 short getMvccUpdatePolicy()
           
 String getMvccUpdatePolicyName()
           
 String getName()
           
 int getPersistLingerTimeMillis()
           
 Long getRemoteTxId()
           
 long getStartTime()
           
 int getTransactionTimeout()
           
 short getTransactionType()
          returns the transaction type, based on the TX_TYPE_* constants (GigaSpaces, TopLink Grid, LLAPI-MVCC, LLAPI-PL).
 String getTransactionTypeName()
          returns the transaction type as a string, based on the TX_TYPE_* constants, such as "TX_TYPE_COH_LLAPI_MVCC".
 short getUpdatePolicy()
           
 boolean getUseClientCache()
           
 boolean isLogAfterCommit()
           
 boolean isLogBeforeCommit()
           
 boolean isPrepareFromManager()
           
 boolean isTransactionTypeLLAPI()
           
 void setCohortTransactionHearbeatPeriod(int cohortTransactionHearbeatPeriod)
           
 void setInternalTxId(long internalTxId)
           
 void setLogAfterCommit(boolean logAfterCommit)
           
 void setLogBeforeCommit(boolean logBeforeCommit)
           
 void setMvccUpdatePolicy(short mvccUpdatePolicy)
           
 void setName(String name)
           
 void setPersistLingerTimeMillis(int persistLingerTimeMillis)
           
 void setPrepareFromManager(boolean prepareFromManager)
           
 void setRemoteTxId(Long remoteTxId)
           
 void setStartTime(long startTime)
           
 void setTransactionTimeout(int transactionTimeout)
          This is the amount of milliseconds to delay before timing out the transaction.
 void setTransactionType(short t)
           
 void setUpdatePolicy(short mvccUpdatePolicy)
           
 void setUseClientCache(boolean useClientCache)
           
 boolean useClientCache()
           
 

Field Detail

DEFAULT_TRANSACTION_TIMEOUT

static final int DEFAULT_TRANSACTION_TIMEOUT
This is the default transaction timeout for this CloudTran run, in seconds. It is used as the initial value for the transactionTimeout field.

By default this is 10 seconds in production, 300 seconds (5 minutes) in debug mode. You can set your own default value via the ct.manager.defaultTimeoutSeconds config.properties value.


DEFAULT_COHORT_TRANSACTION_HEARTBEAT_PERIOD

static final int DEFAULT_COHORT_TRANSACTION_HEARTBEAT_PERIOD
This is only used in CloudTran for GigaSpaces.

This is the default cohort transaction heartbeat period for this run.


TX_TYPE_GS

static final short TX_TYPE_GS
GigaSpaces transaction

See Also:
Constant Field Values

TX_TYPE_COH_TLG

static final short TX_TYPE_COH_TLG
Defines the type of transaction to be Coherence / TopLink Grid

See Also:
Constant Field Values

TX_TYPE_COH_LLAPI_PL

static final short TX_TYPE_COH_LLAPI_PL
Defines the type of transaction to be Coherence / Low-level API / Pessimistic Locking

See Also:
Constant Field Values

TX_TYPE_COH_LLAPI_MVCC

static final short TX_TYPE_COH_LLAPI_MVCC
Defines the type of transaction to be Coherence / Low-level API / MVCC

See Also:
Constant Field Values

UPDATECHECK_WRITE

static final short UPDATECHECK_WRITE
In LLAPI/MVCC transactions, this policy prevents write conflicts.

An MVCC update (put/remove) is prevented if the entry being updated has been updated by another transaction since the current transaction was started.

This is the default policy for LLAPI/MVCC transactions.

See Also:
Constant Field Values

UPDATECHECK_NONE

static final short UPDATECHECK_NONE
In LLAPI/MVCC transactions, no checks are made on the update.

This policy allows a value continuously updated by overlapping transactions.

See Also:
Constant Field Values

UPDATECHECK_READWRITE

static final short UPDATECHECK_READWRITE
In LLAPI/MVCC transactions, this policy prevents read-write conflicts (aka 'write-skew' conflicts).

This policy does the UPDATECHECK_WRITE, but additionally checks that all the values read by this transaction have also not been updated since the current transaction was started.

See Also:
Constant Field Values
Method Detail

getName

String getName()

setName

void setName(String name)

getTransactionTimeout

int getTransactionTimeout()

setTransactionTimeout

void setTransactionTimeout(int transactionTimeout)
This is the amount of milliseconds to delay before timing out the transaction.


getCohortTransactionHearbeatPeriod

int getCohortTransactionHearbeatPeriod()

setCohortTransactionHearbeatPeriod

void setCohortTransactionHearbeatPeriod(int cohortTransactionHearbeatPeriod)

getInternalTxId

long getInternalTxId()

setInternalTxId

void setInternalTxId(long internalTxId)

getPersistLingerTimeMillis

int getPersistLingerTimeMillis()

setPersistLingerTimeMillis

void setPersistLingerTimeMillis(int persistLingerTimeMillis)

getIds

String getIds()
Returns:
gets the 'ids' for the transaction. This will be at least an unique transaction number (e.g. 12345678). If the name has been specified for the transaction, that will be shown too (e.g. "12345678/TxName");

isLogBeforeCommit

boolean isLogBeforeCommit()

isLogAfterCommit

boolean isLogAfterCommit()

setLogBeforeCommit

void setLogBeforeCommit(boolean logBeforeCommit)

setLogAfterCommit

void setLogAfterCommit(boolean logAfterCommit)

getTransactionType

short getTransactionType()
returns the transaction type, based on the TX_TYPE_* constants (GigaSpaces, TopLink Grid, LLAPI-MVCC, LLAPI-PL).


setTransactionType

void setTransactionType(short t)

isTransactionTypeLLAPI

boolean isTransactionTypeLLAPI()

getTransactionTypeName

String getTransactionTypeName()
returns the transaction type as a string, based on the TX_TYPE_* constants, such as "TX_TYPE_COH_LLAPI_MVCC".


getMvccUpdatePolicyName

String getMvccUpdatePolicyName()

getClone

CTxDefinition getClone()

getRemoteTxId

Long getRemoteTxId()

setRemoteTxId

void setRemoteTxId(Long remoteTxId)

useClientCache

boolean useClientCache()
Returns:
true is 'useClientCache' flag has been set

setUseClientCache

void setUseClientCache(boolean useClientCache)

getStartTime

long getStartTime()

setStartTime

void setStartTime(long startTime)

getUpdatePolicy

short getUpdatePolicy()

setUpdatePolicy

void setUpdatePolicy(short mvccUpdatePolicy)

getMvccUpdatePolicy

short getMvccUpdatePolicy()

setMvccUpdatePolicy

void setMvccUpdatePolicy(short mvccUpdatePolicy)

getUseClientCache

boolean getUseClientCache()

isPrepareFromManager

boolean isPrepareFromManager()

setPrepareFromManager

void setPrepareFromManager(boolean prepareFromManager)