SQLiteTransactor

SQLite Transactor

Describes a function which is provided as a transactional closure to the SQLite driver; the transactor executes the steps of the transaction itself, and may be subject to rollback or retries as determined by the engine.

This type is typically not accessible directly by user code, but is instead consumed by the SQLiteTransaction created by the driver to facilitate execution.

 

Idempotency

Because transactions are subject to rollback and retry, the transactor should be idempotent; that is, it should be safe to execute the transaction multiple times without causing side effects.

For more information about transaction behavior, see the SQLiteTransaction documentation.

Parameters

R

Return value type.

See also

Transaction API

Functions

Link copied to clipboard
open fun dispatch(database: SQLiteDatabase, args: Array<out Any?>): R

Transaction dispatch; called by the SQLite engine to invoke the transaction function.

Link copied to clipboard
abstract fun SQLiteDatabase.transact(vararg args: Any?): R

Execute the transaction; this method is called by the SQLite driver to execute the transaction, and may be called multiple times in the event of a rollback or retry.