Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
hazelcast::client::TransactionContext Class Reference

Provides a context to do transactional operations; so beginning/committing transactions, but also retrieving transactional data-structures like the TransactionalMap. More...

#include <TransactionContext.h>

Public Member Functions

 TransactionContext (spi::ClientContext &clientContext, const TransactionOptions &)
 Constructor to be used internally. More...
 
std::string getTxnId () const
 
void beginTransaction ()
 Begins a transaction. More...
 
void commitTransaction ()
 Commits a transaction. More...
 
void rollbackTransaction ()
 Begins a transaction. More...
 
template<typename K , typename V >
TransactionalMap< K, V > getMap (const std::string &name)
 Returns the transactional distributed map instance with the specified name. More...
 
template<typename E >
TransactionalQueue< E > getQueue (const std::string &name)
 Returns the transactional queue instance with the specified name. More...
 
template<typename K , typename V >
TransactionalMultiMap< K, V > getMultiMap (const std::string &name)
 Returns the transactional multimap instance with the specified name. More...
 
template<typename E >
TransactionalList< E > getList (const std::string &name)
 Returns the transactional list instance with the specified name. More...
 
template<typename E >
TransactionalSet< E > getSet (const std::string &name)
 Returns the transactional set instance with the specified name. More...
 
template<typename T >
getTransactionalObject (const std::string &name)
 get any transactional object with template T. More...
 

Detailed Description

Provides a context to do transactional operations; so beginning/committing transactions, but also retrieving transactional data-structures like the TransactionalMap.

See Also
HazelcastClient::newTransactionContext

Constructor & Destructor Documentation

hazelcast::client::TransactionContext::TransactionContext ( spi::ClientContext &  clientContext,
const TransactionOptions txnOptions 
)

Constructor to be used internally.

Not public API.

Member Function Documentation

void hazelcast::client::TransactionContext::beginTransaction ( )

Begins a transaction.

Exceptions
IllegalStateExceptionif a transaction already is active.
void hazelcast::client::TransactionContext::commitTransaction ( )

Commits a transaction.

Exceptions
TransactionExceptionif no transaction is active or the transaction could not be committed.
template<typename E >
TransactionalList< E > hazelcast::client::TransactionContext::getList ( const std::string &  name)
inline

Returns the transactional list instance with the specified name.

Parameters
namename of the list
Returns
transactional list instance with the specified name
template<typename K , typename V >
TransactionalMap<K, V> hazelcast::client::TransactionContext::getMap ( const std::string &  name)
inline

Returns the transactional distributed map instance with the specified name.

Parameters
namename of the distributed map
Returns
transactional distributed map instance with the specified name
template<typename K , typename V >
TransactionalMultiMap<K, V> hazelcast::client::TransactionContext::getMultiMap ( const std::string &  name)
inline

Returns the transactional multimap instance with the specified name.

Parameters
namename of the multimap
Returns
transactional multimap instance with the specified name
template<typename E >
TransactionalQueue< E > hazelcast::client::TransactionContext::getQueue ( const std::string &  name)
inline

Returns the transactional queue instance with the specified name.

Parameters
namename of the queue
Returns
transactional queue instance with the specified name
template<typename E >
TransactionalSet< E > hazelcast::client::TransactionContext::getSet ( const std::string &  name)
inline

Returns the transactional set instance with the specified name.

Parameters
namename of the set
Returns
transactional set instance with the specified name
template<typename T >
T hazelcast::client::TransactionContext::getTransactionalObject ( const std::string &  name)
inline

get any transactional object with template T.

Mostly to be used by spi implementers of Hazelcast.

Returns
transactionalObject.
std::string hazelcast::client::TransactionContext::getTxnId ( ) const
Returns
txn id.
void hazelcast::client::TransactionContext::rollbackTransaction ( )

Begins a transaction.

Exceptions
IllegalStateExceptionif a transaction already is active.

The documentation for this class was generated from the following files: