runTransaction<T> abstract method

Future<T> runTransaction<T>(
  1. Future<T> delegate(
    1. DatabaseContext context
    )
)

Runs delegate inside a transaction.

If delegate returns without throwing an exception, the transaction is committed and the return value is passed through as return value of this method.

If delegate throws an exception, the transaction is rolled back and the exception is rethrown.

Implementation

Future<T> runTransaction<T>(
    Future<T> Function(DatabaseContext context) delegate);