or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

aggregation.mdauthentication-security.mdbson-types.mdchange-streams.mdcollection-operations.mdconfiguration.mdconnection-management.mddatabase-operations.mdgridfs.mdindex.mdquery-building.mdsessions-transactions.md

sessions-transactions.mddocs/

0

# Sessions & Transactions

1

2

Client session management for multi-document ACID transactions and causally consistent read operations with automatic retry logic.

3

4

## Capabilities

5

6

### ClientSession Interface

7

8

```java { .api }

9

public interface ClientSession extends Closeable {

10

ServerSession getServerSession();

11

BsonTimestamp getOperationTime();

12

BsonDocument getClusterTime();

13

14

void startTransaction();

15

void startTransaction(TransactionOptions transactionOptions);

16

void commitTransaction();

17

void abortTransaction();

18

19

<T> T withTransaction(TransactionBody<T> transactionBody);

20

<T> T withTransaction(TransactionBody<T> transactionBody, TransactionOptions options);

21

22

boolean hasActiveTransaction();

23

boolean notifyMessageSent();

24

void close();

25

}

26

27

@FunctionalInterface

28

public interface TransactionBody<T> {

29

T execute() throws Exception;

30

}

31

```

32

33

*[Full sessions and transactions documentation would follow...]*