Skip to content

Commit d87eb64

Browse files
author
Alexander Lavrukov
committed
isDryRun in transaction
1 parent 3746e80 commit d87eb64

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

repository/src/main/java/tech/ydb/yoj/repository/db/StdTxManager.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ public boolean isFirstLevelCache() {
337337
return options.isFirstLevelCache();
338338
}
339339

340+
@Override
341+
public boolean isDryRun() {
342+
return options.isDryRun();
343+
}
344+
340345
@Nullable
341346
@Override
342347
public IsolationLevel getIsolationLevel() {

repository/src/main/java/tech/ydb/yoj/repository/db/TxImpl.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ private <R> R runImpl(Supplier<R> supplier) {
8686
}
8787

8888
if (dryRun) {
89-
doRollback(true,
90-
String.format("[%s] runInTx(): Rollback because dry-run transaction read inconsistent data", sw));
91-
log.debug("[{}] runInTx(): Rollback due to dry-run mode {}", sw, formatExecutionLogMultiline("# "));
89+
doRollback(true, String.format("[%s] runInTx(): Rollback due to DRY-RUN mode", sw));
90+
log.debug("[{}] runInTx(): Rollback due to DRY-RUN mode {}", sw, formatExecutionLogMultiline("# "));
9291
return res;
9392
}
9493

repository/src/main/java/tech/ydb/yoj/repository/db/TxManagerState.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ public interface TxManagerState {
1919
boolean isScan();
2020

2121
boolean isFirstLevelCache();
22+
23+
boolean isDryRun();
2224
}

0 commit comments

Comments
 (0)