runInTransaction<T> abstract method

Future<T> runInTransaction<T>(
  1. Future<T> action()
)

Runs the given action within a transaction.

The transaction is automatically committed if the action completes successfully, or rolled back if an exception is thrown.

Datapod supports nested transactions by using database savepoints. If runInTransaction is called while already in a transaction, a savepoint is created, and the inner action is executed relative to it.

Uses Zones to propagate the transaction context across asynchronous gaps.

Implementation

Future<T> runInTransaction<T>(Future<T> Function() action);