---
name: "mongoc_client_session_with_transaction_cb_t"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_client_session_with_transaction_cb_t"
---

# mongoc\_client\_session\_with\_transaction\_cb\_t(3)

## SYNOPSIS

```
typedef bool (*mongoc_client_session_with_transaction_cb_t) (
   mongoc_client_session_t *session,
   void *ctx,
   bson_t **reply,
   bson_error_t *error);
```

Provide this callback to *mongoc\_client\_session\_with\_transaction()*. The callback should run a sequence of operations meant to be contained within a transaction.  The callback should not attempt to start or commit transactions.

## PARAMETERS

- •

  **session**: A *mongoc\_client\_session\_t*.

- •

  **ctx**: A **void\*** set to the the user-provided **ctx** passed to *mongoc\_client\_session\_with\_transaction()*.

- •

  **reply**: An optional location for a *bson\_t* or **NULL**. The callback should set this if it runs any operations against the server and receives replies.

- •

  **error**: A *bson\_error\_t*. The callback should set this if it receives any errors while running operations against the server.

## RETURN

Returns **true** for success and **false** on failure. If **cb** returns **false** then it should also set **error**.

**SEE ALSO:**

```
mongoc_client_session_with_transaction()
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
