Tx

class Tx(rt: <Error class: unknown class><out <Error class: unknown class>>, tx: <Error class: unknown class><out <Error class: unknown class>>) : Transaction(source)

Represents a specific implementation of the Transaction interface. This class facilitates the management of database transactions, including methods to commit, roll back, execute queries, and fetch results.

Transactions in this class are thread-safe, ensuring consistent access to transaction operations through the usage of a Mutex.

This implementation ensures that transactional queries and operations are properly committed or rolled back, and verifies the transactional state before allowing execution.

Parameters

tx

A pointer to the transaction object in memory used for transactional operations.

Constructors

Link copied to clipboard
constructor(rt: <Error class: unknown class><out <Error class: unknown class>>, tx: <Error class: unknown class><out <Error class: unknown class>>)

Creates an instance of the Tx class with the given transaction pointer.

Properties

Link copied to clipboard
open override val status: Transaction.Status

Functions

Link copied to clipboard
open fun assertIsOpen()
Link copied to clipboard
open suspend override fun commit(): Result<Unit>
Link copied to clipboard
open suspend override fun execute(statement: Statement): Result<Long>
open suspend override fun execute(sql: String): Result<Long>
Link copied to clipboard
open suspend fun <T> fetchAll(sql: String, rowMapper: RowMapper<T>): Result<List<T>>
open suspend override fun fetchAll(statement: Statement): Result<ResultSet>
open suspend override fun fetchAll(sql: String): Result<ResultSet>
open suspend override fun <T> fetchAll(statement: Statement, rowMapper: RowMapper<T>): Result<List<T>>
Link copied to clipboard
open suspend override fun rollback(): Result<Unit>