Main class for creating a transaction.
More...
#include <transactions.hxx>
Main class for creating a transaction.
- Examples:
- examples/game_server.cxx.
◆ transactions()
Create a transactions object.
Creates a transactions object, which can be used to run transactions within the current thread.
- Parameters
-
cluster | The cluster to use for the transactions. |
config | The configuration parameters to use for the transactions. |
◆ cleanup() [1/2]
CB_NODISCARD const transactions_cleanup& couchbase::transactions::transactions::cleanup |
( |
| ) |
const |
|
inline |
◆ cleanup() [2/2]
CB_NODISCARD transactions_cleanup& couchbase::transactions::transactions::cleanup |
( |
| ) |
|
|
inline |
◆ close()
void couchbase::transactions::transactions::close |
( |
| ) |
|
Shut down the transactions object.
The transaction object cannot be used after this call. Called in destructor, but available to call sooner if needed.
◆ cluster_ref()
Return a reference to the cluster.
- Returns
- Ref to the cluster used by this transaction object.
◆ commit()
void couchbase::transactions::transactions::commit |
( |
attempt_context & |
ctx | ) |
|
|
inline |
- Stability
- Internal:
- called internally - will likely move
◆ config()
◆ rollback()
void couchbase::transactions::transactions::rollback |
( |
attempt_context & |
ctx | ) |
|
|
inline |
- Stability
- Internal:
- called internally - will likely move
◆ run()
Run a transaction.
Expects a lambda, which it calls with an attempt_context reference to be used in the lambda for the transaction operations.
- Parameters
-
logic | The lambda containing the transaction logic. |
- Returns
- A struct containing some internal state information about the transaction.
- Exceptions
-
- Examples:
- examples/game_server.cxx.
The documentation for this class was generated from the following file: