From 852786d984d84c3a49b271698022d3b5ad7cc6ad Mon Sep 17 00:00:00 2001 From: Gavin King Date: Fri, 11 Sep 2020 21:15:17 +0200 Subject: [PATCH] Ingres and RDMS don't actually support FOR UPDATE At least not in SELECT statements. They do support it in DECLARE CURSOR, which is perhaps where the confusion arose? Related to HHH-14210 --- .../org/hibernate/dialect/IngresDialect.java | 13 ++++++----- .../hibernate/dialect/RDMSOS2200Dialect.java | 22 +++---------------- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java index 08f991c642..e3ad70599c 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/IngresDialect.java @@ -293,15 +293,16 @@ public class IngresDialect extends Dialect { // lock acquisition support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /** + * FOR UPDATE only supported for cursors + * + * @return the empty string + */ @Override - public boolean supportsOuterJoinForUpdate() { - return getVersion() >= 930; + public String getForUpdateString() { + return ""; } - @Override - public boolean forUpdateOfColumns() { - return getVersion() >= 930; - } // current timestamp support ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java index 18920c5770..5289b60803 100755 --- a/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/RDMSOS2200Dialect.java @@ -222,25 +222,9 @@ public class RDMSOS2200Dialect extends Dialect { } /** - * The RDMS DB supports the 'FOR UPDATE OF' clause. However, the RDMS-JDBC - * driver does not support this feature, so a false is return. - * The base dialect also returns a false, but we will leave this over-ride - * in to make sure it stays false. - *

- * {@inheritDoc} - */ - @Override - public boolean forUpdateOfColumns() { - return false; - } - - /** - * Since the RDMS-JDBC driver does not support for updates, this string is - * set to an empty string. Whenever, the driver does support this feature, - * the returned string should be " FOR UPDATE OF". Note that RDMS does not - * support the string 'FOR UPDATE' string. - *

- * {@inheritDoc} + * FOR UPDATE only supported for cursors + * + * @return the empty string */ @Override public String getForUpdateString() {