transaction

abstract fun <R> transaction(runnable: SQLiteTransactor<R>): SQLiteTransaction<R>

Execute Transaction

Execute the provided runnable transaction function against the current SQLite database, applying recovery and exclusion logic where applicable; the return value R yielded by the transaction function is returned to the caller, via the resolution of the provided SQLiteTransaction.

Transaction functions may be executed multiple times to facilitate retry or rollback logic.

For more information about transaction behavior, see Transactions in the main database object docs, and in the SQLite documentation.

Return

Transaction object.

Parameters

runnable

Transaction function to execute.