Skip to content

Transactions

Unit-of-work transactions are now documented as a shared Chronicle workflow with synchronized Kotlin and Java examples.

Beyond commit/rollback, IUnitOfWork (from store.unitOfWorkManager) exposes the outcome of a commit:

MemberUse it for
isSuccessWhether every staged event committed cleanly.
getConstraintViolationsConstraint violations detected on commit.
getConcurrencyViolationsConcurrency violations detected on commit.
getAppendErrorsAppend errors detected on commit.
tryGetLastCommittedEventSequenceNumberHighest sequence committed.
onCompletedA callback invoked once commit or rollback completes.

See the EventStore API reference for the full IUnitOfWork/IUnitOfWorkManager interfaces.

val unitOfWork = store.unitOfWorkManager.begin()
unitOfWork.onCompleted { completed ->
println("Unit of work ${completed.correlationId} completed")
}