GemStone::GemFire::Cache::Generic::CacheTransactionManager Class Reference

Inherits GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::InternalCacheTransactionManager2PC >.


Detailed Description

CacheTransactionManager encapsulates the transactions for a cache

Public Member Functions

void Begin ()
void Commit ()
bool Exists (GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)
bool Exists ()
bool IsSuspended (GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)
void Prepare ()
void Resume (GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)
void Rollback ()
GemStone::GemFire::Cache::Generic::TransactionIdSuspend ()
bool TryResume (GemStone::GemFire::Cache::Generic::TransactionId^ transactionId, int32_t waitTimeInMilliSec)
bool TryResume (GemStone::GemFire::Cache::Generic::TransactionId^ transactionId)

Properties

GemStone::GemFire::Cache::Generic::TransactionId^  TransactionId [get]

Member Function Documentation

void GemStone::GemFire::Cache::Generic::CacheTransactionManager::Begin (  ) 

Creates a new transaction and associates it with the current thread.

Exceptions:
IllegalStateException Throws exception if the thread is already associated with a transaction

void GemStone::GemFire::Cache::Generic::CacheTransactionManager::Commit (  ) 

Commit the transaction associated with the current thread. If the commit operation fails due to a conflict it will destroy the transaction state and throw a CommitConflictException. If the commit operation succeeds,it returns after the transaction state has been merged with committed state. When this method completes, the thread is no longer associated with a transaction.

Exceptions:
IllegalStateException if the thread is not associated with a transaction
CommitConflictException if the commit operation fails due to a write conflict.

bool GemStone::GemFire::Cache::Generic::CacheTransactionManager::Exists ( GemStone::GemFire::Cache::Generic::TransactionId^   transactionId  ) 

Reports the existence of a transaction for the given transactionId. This method can be used to determine if a transaction with the given transaction identifier is currently in progress locally.

Since 3.6.2

Parameters:
transactionId the given transaction identifier
Returns:
true if the transaction is in progress, false otherwise.
isSuspended

bool GemStone::GemFire::Cache::Generic::CacheTransactionManager::Exists (  ) 

Reports the existence of a Transaction for this thread

Returns:
true if a transaction exists, false otherwise

bool GemStone::GemFire::Cache::Generic::CacheTransactionManager::IsSuspended ( GemStone::GemFire::Cache::Generic::TransactionId^   transactionId  ) 

This method can be used to determine if a transaction with the given transaction identifier is currently suspended locally. This method does not check other members for transaction status.

Since 3.6.2

Parameters:
transactionId 
Returns:
true if the transaction is in suspended state, false otherwise
TransactionId

void GemStone::GemFire::Cache::Generic::CacheTransactionManager::Prepare (  ) 

Prepare the first message of two-phase-commit transaction associated with the current thread.

Exceptions:
IllegalStateException if the thread is not associated with a transaction
CommitConflictException if the commit operation fails due to a write conflict.

void GemStone::GemFire::Cache::Generic::CacheTransactionManager::Resume ( GemStone::GemFire::Cache::Generic::TransactionId^   transactionId  ) 

On the current thread, resumes a transaction that was previously suspended using suspend

Since 3.6.2

Parameters:
transactionId the transaction to resume
Exceptions:
IllegalStateException if the thread is associated with a transaction or if would return false for the given transactionId
TransactionId

void GemStone::GemFire::Cache::Generic::CacheTransactionManager::Rollback (  ) 

Roll back the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction and the transaction context is destroyed.

Exceptions:
IllegalStateException if the thread is not associated with a transaction

GemStone::GemFire::Cache::Generic::TransactionId ^ GemStone::GemFire::Cache::Generic::CacheTransactionManager::Suspend (  ) 

Suspends the transaction on the current thread. All subsequent operations performed by this thread will be non-transactional. The suspended transaction can be resumed by calling TransactionId

Since 3.6.2

Returns:
the transaction identifier of the suspended transaction or null if the thread was not associated with a transaction

bool GemStone::GemFire::Cache::Generic::CacheTransactionManager::TryResume ( GemStone::GemFire::Cache::Generic::TransactionId^   transactionId,
int32_t  waitTimeInMilliSec 
)

On the current thread, resumes a transaction that was previously suspended using suspend, or waits for the specified timeout interval if the transaction has not been suspended. This method will return if:

Another thread suspends the transaction

Another thread calls commit/rollback on the transaction

This thread has waited for the specified timeout

This method returns immediately if TransactionId returns false.

Since 3.6.2

Parameters:
transactionId the transaction to resume
waitTimeInMilliSec the maximum milliseconds to wait
Returns:
true if the transaction was resumed, false otherwise

bool GemStone::GemFire::Cache::Generic::CacheTransactionManager::TryResume ( GemStone::GemFire::Cache::Generic::TransactionId^   transactionId  ) 

On the current thread, resumes a transaction that was previously suspended using suspend. This method is equivalent to if (isSuspended(txId)) { resume(txId); } except that this action is performed atomically

Since 3.6.2

Parameters:
transactionId the transaction to resume
Returns:
true if the transaction was resumed, false otherwise


Property Documentation

GemStone:: GemFire:: Cache:: Generic:: TransactionId^ GemStone::GemFire::Cache::Generic::CacheTransactionManager::TransactionId [get]

Returns the transaction identifier for the current thread

Since 3.6.2

Returns:
the transaction identifier or null if no transaction exists


GemFire C++ Cache .NET API Documentation