From c198fcfe1c6bfc15b79164c88619b6c31729df8c Mon Sep 17 00:00:00 2001 From: fmusolino Date: Mon, 20 May 2024 09:03:53 +0200 Subject: [PATCH] HHH-18132 Fix minimum version check for skip locked on HANA --- .../java/org/hibernate/dialect/AbstractHANADialect.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java index 225a5ea404..d0056ae6f8 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/AbstractHANADialect.java @@ -1952,7 +1952,8 @@ public abstract class AbstractHANADialect extends Dialect { @Override public boolean supportsSkipLocked() { - return getVersion().isSameOrAfter(2, 0, 3); + // HANA supports IGNORE LOCKED since HANA 2.0 SPS3 (2.0.030) + return getVersion().isSameOrAfter(2, 0, 30); } @Override @@ -1965,4 +1966,9 @@ public abstract class AbstractHANADialect extends Dialect { return supportsSkipLocked() ? getForUpdateString(aliases) + SQL_IGNORE_LOCKED : getForUpdateString(aliases); } + + @Override + public String getForUpdateString(LockMode lockMode) { + return super.getForUpdateString(lockMode); + } }