timedTransaction

fun <T> timedTransaction(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, statement: JdbcTransaction.() -> T): TimedValue<T>

Executes a database transaction and measures its execution time.

Return

a TimedValue containing the result and the elapsed duration

Parameters

db

the Database to use, or null for the default database

transactionIsolation

the JDBC transaction isolation level

statement

the transaction body to execute

Type Parameters

T

the return type of the transaction