370#include <mongocxx/v1/detail/postlude.hpp>
Options for mongocxx::v1::client_session.
Definition client_session.hpp:285
~options()
Destroy this object.
options & default_transaction_opts(v1::transaction_options const &v)
Set the "defaultTransactionOptions" field.
options & snapshot(bool v)
Set the "snapshot" field.
options(options &&other) noexcept
Move constructor.
options & causal_consistency(bool v)
Set the "causalConsistency" field.
bsoncxx::v1::document::view cluster_time() const
Return this session's current "clusterTime" value.
client_session(client_session &&other) noexcept
Move constructor.
void advance_operation_time(bsoncxx::v1::types::b_timestamp v)
Advance the "operationTime" value for this session.
v1::client const & client() const
Return the associated client object.
bsoncxx::v1::types::b_timestamp operation_time() const
Return this session's current "operationTime" value.
void start_transaction(v1::transaction_options const &opts)
Start a new transaction using opts instead of default transaction options.
std::uint32_t server_id() const
Return the ID of the current pinned server.
~client_session()
Destroy this object.
transaction_state get_transaction_state() const
Return the current transaction state.
bool get_dirty() const
Return true when the current session is dirty.
std::function< void(client_session &)> with_transaction_cb
The callback function to invoke within a standalone transaction.
Definition client_session.hpp:223
transaction_state
The state of an associated transaction.
Definition client_session.hpp:61
@ k_transaction_none
No associated transaction.
Definition client_session.hpp:65
@ k_transaction_in_progress
The associated transaction is in progress.
Definition client_session.hpp:75
@ k_transaction_committed
The associated transaction was committed.
Definition client_session.hpp:80
@ k_transaction_aborted
The associated transaction was aborted.
Definition client_session.hpp:85
@ k_transaction_starting
An associated transaction has started.
Definition client_session.hpp:70
void abort_transaction()
Abort the current transaction.
void commit_transaction()
Commit the current transaction.
options opts() const
Return the options used to create this client session.
void advance_cluster_time(bsoncxx::v1::document::view v)
Advance the "clusterTime" value for this session.
void with_transaction(with_transaction_cb const &fn, v1::transaction_options const &opts)
Start and commit a new standalone transaction using fn.
Options related to a distributed transaction.
Definition transaction_options.hpp:50
Provides macros to control the set of symbols exported in the ABI.
#define MONGOCXX_ABI_CDECL
Expands to __cdecl when built with MSVC on Windows.
Definition export.hpp:49
#define MONGOCXX_ABI_EXPORT_CDECL(...)
Equivalent to MONGOCXX_ABI_EXPORT with MONGOCXX_ABI_CDECL.
Definition export.hpp:52
The mongocxx v1 macro guard prelude header.
The top-level namespace within which all bsoncxx library entities are declared.
Declares entities whose ABI stability is guaranteed for documented symbols.
The top-level namespace within which all mongocxx library entities are declared.
Declares mongocxx::v1::transaction_options.
Declares mongocxx::v1::client.
Declares mongocxx::v1::client_session.
Declares bsoncxx::v1::document::view.
Provides std::optional-related polyfills for library API usage.
Declares non-owning, read-only entities representing a BSON type value.