From 4fb11c99197bbf80387dc2641a3b55daa81adeec Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Fri, 5 Feb 2016 15:01:06 +0000 Subject: [PATCH] HHH-9635 - Fix SQLServer2005Dialect (and above) does not support read past locking --- .../java/org/hibernate/dialect/SQLServer2005Dialect.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java index c96a3eac9b..47ad18f3dd 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SQLServer2005Dialect.java @@ -76,11 +76,12 @@ public class SQLServer2005Dialect extends SQLServerDialect { case UPGRADE: case PESSIMISTIC_WRITE: case WRITE: { - return tableName + " with (updlock, rowlock" + noWaitStr + " )"; + return tableName + " with (updlock, rowlock" + noWaitStr + ")"; } case PESSIMISTIC_READ: { - return tableName + " with (holdlock, rowlock" + noWaitStr + " )"; - } + return tableName + " with (holdlock, rowlock" + noWaitStr + ")"; + }case UPGRADE_SKIPLOCKED: + return tableName + " with (updlock, rowlock, readpast" + noWaitStr + ")"; default: { return tableName; }