![]() |
GridGain C++
|
Ignite cache transaction. More...
#include <transaction.h>
Public Member Functions | |
Transaction (common::concurrent::SharedPointer< impl::transactions::TransactionImpl > impl) | |
Constructor. More... | |
Transaction (const Transaction &other) | |
Copy constructor. More... | |
Transaction & | operator= (const Transaction &other) |
Assignment operator. More... | |
~Transaction () | |
Destructor. | |
void | Commit () |
Commit the transaction. More... | |
void | Commit (IgniteError &err) |
Commit the transaction. More... | |
void | Rollback () |
Rollback the transaction. More... | |
void | Rollback (IgniteError &err) |
Rollback the transaction. More... | |
void | Close () |
Close the transaction. More... | |
void | Close (IgniteError &err) |
Close the transaction. More... | |
void | SetRollbackOnly () |
Make transaction into rollback-only. More... | |
void | SetRollbackOnly (IgniteError &err) |
Make transaction into rollback-only. More... | |
bool | IsRollbackOnly () |
Check if the transaction is rollback-only. More... | |
bool | IsRollbackOnly (IgniteError &err) |
Check if the transaction is rollback-only. More... | |
TransactionState::Type | GetState () |
Get current state. More... | |
TransactionState::Type | GetState (IgniteError &err) |
Get current state. More... | |
TransactionConcurrency::Type | GetConcurrency () const |
Get concurrency. More... | |
TransactionIsolation::Type | GetIsolation () const |
Get isolation. More... | |
int64_t | GetTimeout () const |
Get timeout. More... | |
bool | IsValid () const |
Check if the instance is valid and can be used. More... | |
Ignite cache transaction.
Cache transactions have a default 2PC (two-phase-commit) behavior.
This class is implemented as a reference to an implementation so copying of this class instance will only create another reference to the same underlying object. Underlying object will be released automatically once all the instances are destructed.
ignite::transactions::Transaction::Transaction | ( | common::concurrent::SharedPointer< impl::transactions::TransactionImpl > | impl | ) |
Constructor.
Internal method. Should not be used by user.
impl | Implementation. |
ignite::transactions::Transaction::Transaction | ( | const Transaction & | other | ) |
Copy constructor.
other | Other instance. |
void ignite::transactions::Transaction::Close | ( | ) |
Close the transaction.
This method should only be used on the valid instance.
IgniteError | class instance in case of failure. |
void ignite::transactions::Transaction::Close | ( | IgniteError & | err | ) |
Close the transaction.
Properly sets error param in case of failure.
This method should only be used on the valid instance.
err | Error. |
void ignite::transactions::Transaction::Commit | ( | ) |
Commit the transaction.
This method should only be used on the valid instance.
IgniteError | class instance in case of failure. |
void ignite::transactions::Transaction::Commit | ( | IgniteError & | err | ) |
Commit the transaction.
Properly sets error param in case of failure.
This method should only be used on the valid instance.
err | Error. |
|
inline |
Get concurrency.
This method should only be used on the valid instance.
|
inline |
Get isolation.
This method should only be used on the valid instance.
TransactionState::Type ignite::transactions::Transaction::GetState | ( | ) |
Get current state.
This method should only be used on the valid instance.
IgniteError | class instance in case of failure. |
TransactionState::Type ignite::transactions::Transaction::GetState | ( | IgniteError & | err | ) |
Get current state.
Properly sets error param in case of failure.
This method should only be used on the valid instance.
err | Error. |
|
inline |
Get timeout.
This method should only be used on the valid instance.
bool ignite::transactions::Transaction::IsRollbackOnly | ( | ) |
Check if the transaction is rollback-only.
After transaction have been marked as rollback-only it may only be rolled back. Error occurs if such transaction is being commited.
IgniteError | class instance in case of failure. |
bool ignite::transactions::Transaction::IsRollbackOnly | ( | IgniteError & | err | ) |
Check if the transaction is rollback-only.
After transaction have been marked as rollback-only it may only be rolled back. Error occurs if such transaction is being commited.
Properly sets error param in case of failure.
This method should only be used on the valid instance.
err | Error. |
|
inline |
Check if the instance is valid and can be used.
Invalid instance can be returned if some of the previous operations have resulted in a failure. For example invalid instance can be returned by not-throwing version of method in case of error. Invalid instances also often can be created using default constructor.
Transaction & ignite::transactions::Transaction::operator= | ( | const Transaction & | other | ) |
Assignment operator.
other | Other instance. |
void ignite::transactions::Transaction::Rollback | ( | ) |
Rollback the transaction.
This method should only be used on the valid instance.
IgniteError | class instance in case of failure. |
void ignite::transactions::Transaction::Rollback | ( | IgniteError & | err | ) |
Rollback the transaction.
Properly sets error param in case of failure.
This method should only be used on the valid instance.
err | Error. |
void ignite::transactions::Transaction::SetRollbackOnly | ( | ) |
Make transaction into rollback-only.
After transaction have been marked as rollback-only it may only be rolled back. Error occurs if such transaction is being commited.
This method should only be used on the valid instance.
IgniteError | class instance in case of failure. |
void ignite::transactions::Transaction::SetRollbackOnly | ( | IgniteError & | err | ) |
Make transaction into rollback-only.
After transaction have been marked as rollback-only it may only be rolled back. Error occurs if such transaction is being commited.
Properly sets error param in case of failure.
This method should only be used on the valid instance.
err | Error. |