MongoDB Java Driver legacy all-in-one JAR providing comprehensive database connectivity for Java applications with synchronous APIs, CRUD operations, aggregation, GridFS, change streams, and authentication support
—
Client session management for multi-document ACID transactions and causally consistent read operations with automatic retry logic.
public interface ClientSession extends Closeable {
ServerSession getServerSession();
BsonTimestamp getOperationTime();
BsonDocument getClusterTime();
void startTransaction();
void startTransaction(TransactionOptions transactionOptions);
void commitTransaction();
void abortTransaction();
<T> T withTransaction(TransactionBody<T> transactionBody);
<T> T withTransaction(TransactionBody<T> transactionBody, TransactionOptions options);
boolean hasActiveTransaction();
boolean notifyMessageSent();
void close();
}
@FunctionalInterface
public interface TransactionBody<T> {
T execute() throws Exception;
}[Full sessions and transactions documentation would follow...]
Install with Tessl CLI
npx tessl i tessl/maven-org-mongodb--mongo-java-driver