com.palantir.atlasdb.transaction.api.TransactionManager.runTaskWithConditionThrowOnConflict()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(126)

本文整理了Java中com.palantir.atlasdb.transaction.api.TransactionManager.runTaskWithConditionThrowOnConflict()方法的一些代码示例,展示了TransactionManager.runTaskWithConditionThrowOnConflict()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TransactionManager.runTaskWithConditionThrowOnConflict()方法的具体详情如下:
包路径:com.palantir.atlasdb.transaction.api.TransactionManager
类名称:TransactionManager
方法名:runTaskWithConditionThrowOnConflict

TransactionManager.runTaskWithConditionThrowOnConflict介绍

[英]This method is basically the same as #runTaskThrowOnConflict(TransactionTask), but it takes a PreCommitCondition and checks it immediately before the transaction commits.

The created transaction will not commit successfully if the check fails.
[中]此方法基本上与#runtaskstrowoncolflict(TransactionTask)相同,但它会在事务提交前立即接受预提交条件并进行检查。
如果检查失败,创建的事务将无法成功提交。

代码示例

代码示例来源:origin: palantir/atlasdb

@Override
public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict(
    C condition,
    ConditionAwareTransactionTask<T, C, E> task)
    throws E, TransactionFailedRetriableException {
  return delegate().runTaskWithConditionThrowOnConflict(condition, wrapTask(task));
}

代码示例来源:origin: com.palantir.atlasdb/atlasdb-impl-shared

@Override
public <T, C extends PreCommitCondition, E extends Exception> T runTaskWithConditionThrowOnConflict(
    C condition,
    ConditionAwareTransactionTask<T, C, E> task)
    throws E, TransactionFailedRetriableException {
  return delegate().runTaskWithConditionThrowOnConflict(condition, wrapTask(task));
}

相关文章