cancelTransaction method

  1. @override
bool cancelTransaction(
  1. Transaction transaction,
  2. DBSQLMemoryAdapterContext? connection,
  3. Object? error,
  4. StackTrace? stackTrace,
)
override

Implementation

@override
bool cancelTransaction(
    Transaction transaction,
    DBSQLMemoryAdapterContext? connection,
    Object? error,
    StackTrace? stackTrace) {
  if (connection == null) return true;
  _openTransactionsContexts.remove(connection);

  _rollbackTables(
      connection.tablesVersions, connection.tablesIndexesVersions);

  // ignore: discarded_futures
  disposePoolElement(connection);
  return true;
}