.\" Man page generated from reStructuredText. . .TH "MONGOC_SESSION_OPT_T" "3" "Jun 04, 2021" "1.17.6" "libmongoc" .SH NAME mongoc_session_opt_t \- mongoc_session_opt_t . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C #include typedef struct _mongoc_session_opt_t mongoc_session_opt_t; .ft P .fi .UNINDENT .UNINDENT .SH SYNOPSIS .sp Start a session with \fBmongoc_client_start_session\fP, use the session for a sequence of operations and multi\-document transactions, then free it with \fBmongoc_client_session_destroy()\fP\&. Any \fBmongoc_cursor_t\fP or \fBmongoc_change_stream_t\fP using a session must be destroyed before the session, and a session must be destroyed before the \fBmongoc_client_t\fP it came from. .sp By default, sessions are \fI\%causally consistent\fP\&. To disable causal consistency, before starting a session create a \fBmongoc_session_opt_t\fP with \fBmongoc_session_opts_new()\fP and call \fBmongoc_session_opts_set_causal_consistency()\fP, then free the struct with \fBmongoc_session_opts_destroy\fP\&. .sp Unacknowledged writes are prohibited with sessions. .sp A \fBmongoc_client_session_t\fP must be used by only one thread at a time. Due to session pooling, \fBmongoc_client_start_session\fP may return a session that has been idle for some time and is about to be closed after its idle timeout. Use the session within one minute of acquiring it to refresh the session and avoid a timeout. .sp See the example code for \fBmongoc_session_opts_set_causal_consistency\fP\&. .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .