executeTransactionPlan

open fun executeTransactionPlan(plan: TransactionPlan, propagation: TransactionPropagation = TransactionPropagation.REQUIRED, isolation: TransactionIsolationLevel? = null, readOnly: Boolean = false, statementTimeout: Duration? = null, transactionTimeout: Duration? = null): TransactionPlanResult

Runs every step of plan in one transaction, in the order they were added, and returns what each produced.

A step's parameters are resolved just before it runs, so a TransactionValue pointing at an earlier step gets the value that step actually produced. Anything else in the map is passed through.

There is no …Result variant of this the way transactionResult is one of transaction, and the asymmetry has a reason: a block can return a failure, which is what a plain transaction would commit over, while a plan's steps can only throw. So dbResult { db.executeTransactionPlan(plan) } is both sufficient and correct.

Return

Every step's result, by handle.

Parameters

plan

The steps to run.

propagation

What to do about a transaction already running on this thread.

isolation

The isolation level to run at, or null for the server's.

readOnly

Whether the transaction refuses writes.

statementTimeout

Aborts any single statement running longer than this.

transactionTimeout

Aborts the transaction once it has been open longer than this.

Throws

INVALID_ARGUMENT where a step refers to an earlier result in a way its shape does not allow.