TransactionManager

A high-level API for managing transactions via scoped blocks.

This manager provides robust block-based transaction scoping, such as required and nested, automatically handling commit, rollback, and savepoints based on the execution result. Within these scopes, the receiver is restricted to OctaviusSessionOperations, preventing manual interference with the transaction lifecycle.

If you need manual, low-level transaction control (e.g., explicit commit(), rollback(), autoCommit manipulation, or manual savepoints), use the methods provided directly on the parent OctaviusSession.

Constructors

Link copied to clipboard
internal constructor(session: OctaviusSession)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T> nested(crossinline block: OctaviusSessionOperations.() -> T): T

Executes the given block within a nested transaction scope.

Link copied to clipboard
inline fun <T> required(crossinline block: OctaviusSessionOperations.() -> T): T

Executes the given block within a transaction scope.

Link copied to clipboard
internal fun restoreAutoCommit(failure: Throwable?)

Puts auto-commit back once a scope is over, however it ended.