inTransaction

Returns true if a transaction is active on the specified or last connection, false otherwise.

It will check the status on the explicitly provided connection, or, if connection is null, it will use the most recently opened and cached connection managed by this KQLiteDatabase instance.

Example

myDatabase.withTransaction {
// This will return true
println("Inside transaction: ${myDatabase.inTransaction()}")
}
// This will return false
println("Outside transaction: ${myDatabase.inTransaction()}")

Return

true if a transaction is active on the specified or default connection, false otherwise. Also returns false if no connection is available.

Author

MOHAMMAD AZIM ANSARI

Parameters

connection

The specific SQLiteConnection to check. If null, the default cached connection for this database instance is used.

See also