From 5b1d0e1afa54404ca442fc07878b02b53c7d7f91 Mon Sep 17 00:00:00 2001 From: alexandertrunin Date: Sun, 25 Aug 2024 07:16:16 +0200 Subject: [PATCH] Fix session closure of snapshot isolation transaction https://github.com/ydb-platform/yoj-project/pull/79#issuecomment-2204376395 --- .../tech/ydb/yoj/repository/ydb/YdbRepositoryTransaction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/YdbRepositoryTransaction.java b/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/YdbRepositoryTransaction.java index 95e4d535..16103671 100644 --- a/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/YdbRepositoryTransaction.java +++ b/repository-ydb-v2/src/main/java/tech/ydb/yoj/repository/ydb/YdbRepositoryTransaction.java @@ -29,6 +29,7 @@ import tech.ydb.table.values.Value; import tech.ydb.yoj.repository.BaseDb; import tech.ydb.yoj.repository.db.Entity; +import tech.ydb.yoj.repository.db.IsolationLevel; import tech.ydb.yoj.repository.db.RepositoryTransaction; import tech.ydb.yoj.repository.db.Table; import tech.ydb.yoj.repository.db.TxOptions; @@ -191,7 +192,7 @@ private boolean isFinalActionNeeded(String actionName) { transactionLocal.log().info("No-op %s: scan tx", actionName); return false; } - if (options.isReadOnly()) { + if (options.isReadOnly() && options.getIsolationLevel() != IsolationLevel.SNAPSHOT) { transactionLocal.log().info("No-op %s: read-only tx @%s", actionName, options.getIsolationLevel()); return false; }