1MONGOC_SESSION_OPTS_SET_DEFAMUOLNTG_OTCR_ASNlESiSAbSCmIToOInNOg_NoO_cPOTPST_SS(E3T)_DEFAULT_TRANSACTION_OPTS(3)
2
3
4
6 mongoc_session_opts_set_default_transaction_opts - mongoc_ses‐
7 sion_opts_set_default_transaction_opts()
8
10 void
11 mongoc_session_opts_set_default_transaction_opts (
12 mongoc_session_opt_t *opts, const mongoc_transaction_opt_t *txn_opts);
13
14 Set the default options for transactions started with this session. The
15 txn_opts argument is copied and can be freed after calling this func‐
16 tion.
17
18 When a session is first created with mongoc_client_start_session(), it
19 inherits from the client the read concern, write concern, and read
20 preference with which to start transactions. Each of these fields can
21 be overridden independently. Create a mongoc_transaction_opt_t with
22 mongoc_transaction_opts_new(), and pass a non-NULL option to any of the
23 mongoc_transaction_opt_t setter functions:
24
25 • mongoc_transaction_opts_set_read_concern()
26
27 • mongoc_transaction_opts_set_write_concern()
28
29 • mongoc_transaction_opts_set_read_prefs()
30
31 Pass the resulting transaction options to
32 mongoc_session_opts_set_default_transaction_opts(). Each field set in
33 the transaction options overrides the inherited client configuration.
34 There is an opportunity to override each one of these fields again by
35 passing a mongoc_transaction_opt_t to
36 mongoc_client_session_start_transaction().
37
39 • opts: A mongoc_session_opt_t.
40
41 • txn_opts: A mongoc_transaction_opt_t.
42
44 MongoDB, Inc
45
47 2017-present, MongoDB, Inc
48
49
50
51
521.23.1 MONGOCO_cStES2S0I,ON2_0O2P2TS_SET_DEFAULT_TRANSACTION_OPTS(3)