abortableWriteLock<T> abstract method

Future<T> abortableWriteLock<T>(
  1. Future<T> callback(
    1. SqliteWriteContext tx
    ), {
  2. Future<void>? abortTrigger,
  3. String? debugContext,
})

Takes a global lock, without starting a transaction.

The lock applies to all SqliteConnection instances for a SqliteDatabase. Locks for separate SqliteDatabase instances on the same database file may be held concurrently.

If abortTrigger is set and completes before the database was able to obtain the write lock, an AbortException will be thrown.

Implementation

Future<T> abortableWriteLock<T>(
    Future<T> Function(SqliteWriteContext tx) callback,
    {Future<void>? abortTrigger,
    String? debugContext});