VMware VMware GemFire Native .NET Reference 10.4.3
|
CacheTransactionManager encapsulates the transactions for a cache. More...
#include <CacheTransactionManager.hpp>
Public Member Functions | |
void | Begin () |
Creates a new transaction and associates it with the current thread. | |
void | Commit () |
Commit the transaction associated with the current thread. | |
bool | Exists () |
Reports the existence of a Transaction for this thread. | |
bool | Exists (Apache::Geode::Client::TransactionId^ transactionId) |
Reports the existence of a transaction for the given transactionId. | |
bool | IsSuspended (Apache::Geode::Client::TransactionId^ transactionId) |
This method can be used to determine if a transaction with the given transaction identifier is currently suspended locally. | |
void | Prepare () |
Prepare the first message of two-phase-commit transaction associated with the current thread. | |
void | Resume (Apache::Geode::Client::TransactionId^ transactionId) |
On the current thread, resumes a transaction that was previously suspended using suspend | |
void | Rollback () |
Roll back the transaction associated with the current thread. | |
Apache::Geode::Client::TransactionId ^ | Suspend () |
Suspends the transaction on the current thread. | |
bool | TryResume (Apache::Geode::Client::TransactionId^ transactionId) |
On the current thread, resumes a transaction that was previously suspended using suspend. | |
bool | TryResume (Apache::Geode::Client::TransactionId^ transactionId, TimeSpan waitTime) |
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. | |
Properties | |
Apache::Geode::Client::TransactionId^ | TransactionId [get] |
Returns the transaction identifier for the current thread. | |
CacheTransactionManager encapsulates the transactions for a cache.
void Apache::Geode::Client::CacheTransactionManager::Begin | ( | ) |
Creates a new transaction and associates it with the current thread.
IllegalStateException | Throws exception if the thread is already associated with a transaction |
void Apache::Geode::Client::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.
IllegalStateException | if the thread is not associated with a transaction |
CommitConflictException | if the commit operation fails due to a write conflict. |
bool Apache::Geode::Client::CacheTransactionManager::Exists | ( | ) |
Reports the existence of a Transaction for this thread.
bool Apache::Geode::Client::CacheTransactionManager::Exists | ( | Apache::Geode::Client::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
transactionId | the given transaction identifier |
isSuspended
bool Apache::Geode::Client::CacheTransactionManager::IsSuspended | ( | Apache::Geode::Client::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
transactionId |
void Apache::Geode::Client::CacheTransactionManager::Prepare | ( | ) |
Prepare the first message of two-phase-commit transaction associated with the current thread.
IllegalStateException | if the thread is not associated with a transaction |
CommitConflictException | if the commit operation fails due to a write conflict. |
void Apache::Geode::Client::CacheTransactionManager::Resume | ( | Apache::Geode::Client::TransactionId^ | transactionId | ) |
On the current thread, resumes a transaction that was previously suspended using suspend
Since 3.6.2
transactionId | the transaction to resume |
IllegalStateException | if the thread is associated with a transaction or if would return false for the given transactionId |
void Apache::Geode::Client::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.
IllegalStateException | if the thread is not associated with a transaction |
Apache::Geode::Client::TransactionId ^ Apache::Geode::Client::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
bool Apache::Geode::Client::CacheTransactionManager::TryResume | ( | Apache::Geode::Client::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
transactionId | the transaction to resume |
bool Apache::Geode::Client::CacheTransactionManager::TryResume | ( | Apache::Geode::Client::TransactionId^ | transactionId, |
TimeSpan | waitTime | ||
) |
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
transactionId | the transaction to resume |
waitTime | the maximum time to wait |
|
get |
Returns the transaction identifier for the current thread.
Since 3.6.2