From 0b34910b22386f930253e3ab8bc8e1b2eb7c8b86 Mon Sep 17 00:00:00 2001 From: Vlad Mihalcea Date: Tue, 28 Jun 2016 17:38:11 +0300 Subject: [PATCH] HHH-10890 - PostgreSQL does not consider alias-specific LockMode --- .../main/java/org/hibernate/dialect/PostgreSQL81Dialect.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java index 48edd57b70..22ad3b9b5d 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/PostgreSQL81Dialect.java @@ -287,7 +287,10 @@ public class PostgreSQL81Dialect extends Dialect { } } } - LockMode lockMode = lockOptions.getLockMode(); + LockMode lockMode = lockOptions.getAliasSpecificLockMode( aliases ); + if (lockMode == null ) { + lockMode = lockOptions.getLockMode(); + } switch ( lockMode ) { case UPGRADE: return getForUpdateString(aliases);