From 3ce6a1351a2ed8d50b146a579418ae4d3a84405e Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Mon, 6 May 2024 17:25:34 +0200 Subject: [PATCH] HHH-17421 Ensure that no follow-on locking happens on SQL Server and Sybase ASE --- .../dialect/SQLServerLegacySqlAstTranslator.java | 9 +++++++++ .../dialect/SybaseASELegacySqlAstTranslator.java | 9 +++++++++ .../community/dialect/SybaseLegacySqlAstTranslator.java | 9 +++++++++ .../org/hibernate/dialect/SQLServerSqlAstTranslator.java | 9 +++++++++ .../org/hibernate/dialect/SybaseASESqlAstTranslator.java | 9 +++++++++ .../org/hibernate/dialect/SybaseSqlAstTranslator.java | 9 +++++++++ 6 files changed, 54 insertions(+) diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java index 20495884f9ee..2b744a2b84f6 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacySqlAstTranslator.java @@ -293,6 +293,15 @@ private void renderLockHint(LockMode lockMode) { } } + @Override + protected LockStrategy determineLockingStrategy( + QuerySpec querySpec, + ForUpdateClause forUpdateClause, + Boolean followOnLocking) { + // No need for follow on locking + return LockStrategy.CLAUSE; + } + @Override protected void renderForUpdateClause(QuerySpec querySpec, ForUpdateClause forUpdateClause) { // SQL Server does not support the FOR UPDATE clause diff --git a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacySqlAstTranslator.java b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacySqlAstTranslator.java index be42647e43c0..b5ace7590994 100644 --- a/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacySqlAstTranslator.java +++ b/hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseASELegacySqlAstTranslator.java @@ -271,6 +271,15 @@ protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin, List