use of io.requery.RollbackException in project requery by requery.
the class EntityDataStore method runInTransaction.
@Override
public <V> V runInTransaction(Callable<V> callable, @Nullable TransactionIsolation isolation) {
Objects.requireNotNull(callable);
checkClosed();
Transaction transaction = transactionProvider.get();
if (transaction == null) {
throw new TransactionException("no transaction");
}
try {
transaction.begin(isolation);
V result = callable.call();
transaction.commit();
return result;
} catch (Exception e) {
transaction.rollback();
throw new RollbackException(e);
}
}
Aggregations