api-docs / org.ktorm.database / Transaction
Transaction
interface Transaction : Closeable
(source code)Representation of a transaction.
Transactional code can use this interface to retrieve the backend connection, and
to programmatically trigger a commit or rollback (instead of implicit commits and rollbacks
of using Database.useTransaction).
Properties
Name | Summary |
---|---|
abstract val connection: Connection The backend JDBC connection of this transaction. |
Functions
Name | Summary |
---|---|
abstract fun close(): Unit Close the transaction and release its underlying resources (e.g. the backend connection). | |
abstract fun commit(): Unit Commit the transaction. | |
abstract fun rollback(): Unit Rollback the transaction. |
Extension Functions
Name | Summary |
---|---|
infix fun <T : Any> T.eq( Equal operator, translated to | |
infix fun <T : Any> T.neq( Not-equal operator, translated to | |
infix fun <T : Any> T.notEq( Not-equal operator, translated to | |
fun <T : AutoCloseable?, R> T.use(block: (T) -> R): R Execute the given block function on this resource and then close it down correctly whether an exception |