GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
MONGOC_SESSION_OPTS_SET_DEFAULT_TRANSACTION_OPTS(3) libmongoc MONGOC_SESSION_OPTS_SET_DEFAULT_TRANSACTION_OPTS(3)

void
mongoc_session_opts_set_default_transaction_opts (

mongoc_session_opt_t *opts, const mongoc_transaction_opt_t *txn_opts);


Set the default options for transactions started with this session. The txn_opts argument is copied and can be freed after calling this function.

When a session is first created with mongoc_client_start_session(), it inherits from the client the read concern, write concern, and read preference with which to start transactions. Each of these fields can be overridden independently. Create a mongoc_transaction_opt_t with mongoc_transaction_opts_new(), and pass a non-NULL option to any of the mongoc_transaction_opt_t setter functions:

  • mongoc_transaction_opts_set_read_concern()
  • mongoc_transaction_opts_set_write_concern()
  • mongoc_transaction_opts_set_read_prefs()

Pass the resulting transaction options to mongoc_session_opts_set_default_transaction_opts(). Each field set in the transaction options overrides the inherited client configuration. There is an opportunity to override each one of these fields again by passing a mongoc_transaction_opt_t to mongoc_client_session_start_transaction().

  • opts: A mongoc_session_opt_t.
  • txn_opts: A mongoc_transaction_opt_t.

MongoDB, Inc

2009-present, MongoDB, Inc.

July 3, 2025 1.30.4

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.