runInTransaction method

Future<void> runInTransaction(
  1. FutureOr<void> fn(
    1. TransactionId?
    )
)

Runs the given fn as an atomic change. All the mutations that are executed using the provided transactionId will be atomic.

Note that mutations for different integrations will not be atomic.

For more information about transactions in Squid, please refer to the documentation.

Implementation

Future<void> runInTransaction(FutureOr<void> Function(TransactionId?) fn) {
  _validateNotDestructed();
  return _dataManager.runInTransaction(fn);
}