org.multiverse.api
Interface TransactionConfig

All Known Implementing Classes:
AbstractTransactionConfig

public interface TransactionConfig

Contains the transaction configuration used by a Transaction. In the beginning this was all placed in the Transaction, adding a lot of 'informational' methods to the transaction and therefor complicating its usage. So all the configurational stuff was moved to a specialized object: the TransactionConfig.

Author:
Peter Veentjer.

Method Summary
 boolean automaticReadTracking()
          Checks if this transaction does automaticReadTracking.
 BackoffPolicy getBackoffPolicy()
          Returns the BackoffPolicy used by the Stm when a transaction conflicts with another transaction.
 java.lang.String getFamilyName()
          Returns the family name of this Transaction.
 int getMaxRetryCount()
          Returns the maximum number of times this Transaction be retried before failing.
 boolean isInterruptible()
          Checks if the Transaction can be interrupted if it is blocking.
 boolean isReadonly()
          Checks if this Transaction is readonly.
 boolean preventWriteSkew()
          Checks if this Transaction should prent writeskew.
 

Method Detail

getBackoffPolicy

BackoffPolicy getBackoffPolicy()
Returns the BackoffPolicy used by the Stm when a transaction conflicts with another transaction.

Returns:
the BackoffPolicy used.

automaticReadTracking

boolean automaticReadTracking()
Checks if this transaction does automaticReadTracking. Read tracking is needed for blocking transactions, but also for writeskew detection. Disadvantage of read tracking is that it is more expensive because the reads not to be registered on some datastructure so that they are tracked.

Returns:
true if the transaction does automatic read tracking, false otherwise.

getFamilyName

java.lang.String getFamilyName()
Returns the family name of this Transaction. Every transaction in principle should have a family name. This information can be used for debugging/logging purposes but also other techniques that rely to know something about similar types of transactions like profiling.

Returns:
the familyName. The returned value can be null.

getMaxRetryCount

int getMaxRetryCount()
Returns the maximum number of times this Transaction be retried before failing. The returned value will always be equal or larger than 0. If the value is set high and you are encountering a lot of TooManyRetryExceptions it could be that the objects are just not concurrent enough.

Returns:
the maxRetryCount.

isInterruptible

boolean isInterruptible()
Checks if the Transaction can be interrupted if it is blocking.

Returns:
true if the Transaction can be interrupted if it is blocking, false otherwise.

isReadonly

boolean isReadonly()
Checks if this Transaction is readonly.

Returns:
true if readonly, false otherwise.

preventWriteSkew

boolean preventWriteSkew()
Checks if this Transaction should prent writeskew. This is an isolation anomaly and could lead to an execution of transactions that doesn't match any sequential execution. Writeskew detection can be expensive because more checks needs to be done. It also leads to lower concurrency because certain executions of transactions are not allowed and are aborted and retried.

If the transaction is readonly, the value is undefined since a readonly transaction can't suffer from the writeskew problem.

Returns:
true if the writeskew problem is prevented, false otherwise.


Copyright © 2008-2010 Multiverse. All Rights Reserved.