executeTransactionOperation<R> method
FutureOr<R>
executeTransactionOperation<R>(
- TransactionOperation op,
- FutureOr<
R> f(- DBObjectGCSAdapterContext connection
Implementation
FutureOr<R> executeTransactionOperation<R>(TransactionOperation op,
FutureOr<R> Function(DBObjectGCSAdapterContext connection) f) {
var transaction = op.transaction;
if (isTransactionWithSingleOperation(op)) {
return executeWithPool(f,
onError: (e, s) => transaction.notifyExecutionError(
e,
s,
errorResolver: resolveError,
operation: op,
debugInfo: () => op.toString(),
));
}
if (transaction.isOpen) {
return transaction.addExecution<R, DBObjectGCSAdapterContext>(
f,
errorResolver: resolveError,
operation: op,
debugInfo: () => op.toString(),
);
}
if (!transaction.isOpening) {
transaction.open(
() => openTransaction(transaction),
callCloseTransactionRequired
? () => closeTransaction(
transaction, transaction.context as DBObjectGCSAdapterContext?)
: null,
);
}
return transaction.onOpen<R>(() {
return transaction.addExecution<R, DBObjectGCSAdapterContext>(
f,
errorResolver: resolveError,
operation: op,
debugInfo: () => op.toString(),
);
});
}