diff --git a/jOOQ/pom.xml b/jOOQ/pom.xml
index b425580b40..34e60b62f0 100644
--- a/jOOQ/pom.xml
+++ b/jOOQ/pom.xml
@@ -54,7 +54,7 @@
src/main/resources/xsd
src/main/resources/xjb
- jooq-runtime-3.8.0.xsd
+ jooq-runtime-3.9.0.xsd
org.jooq.conf
diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java
index de89c818da..8be3960881 100644
--- a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java
+++ b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java
@@ -242,7 +242,8 @@ public class UpdatableRecordImpl> extends TableReco
// [#1547] Try fetching the Record again first, and compare this
// Record's original values with the ones in the database
- else {
+ // [#5384] Do this only if the exclusion flag for unversioned records is off
+ else if (isExecuteWithOptimisticLockingIncludeUnversioned()) {
checkIfChanged(keys);
}
}
@@ -297,7 +298,8 @@ public class UpdatableRecordImpl> extends TableReco
// [#1547] Try fetching the Record again first, and compare this
// Record's original values with the ones in the database
- else {
+ // [#5384] Do this only if the exclusion flag for unversioned records is off
+ else if (isExecuteWithOptimisticLockingIncludeUnversioned()) {
checkIfChanged(keys);
}
}
@@ -385,11 +387,18 @@ public class UpdatableRecordImpl> extends TableReco
Configuration configuration = configuration();
// This can be null when the current record is detached
- if (configuration != null) {
- return TRUE.equals(configuration.settings().isExecuteWithOptimisticLocking());
- }
+ return configuration != null
+ ? TRUE.equals(configuration.settings().isExecuteWithOptimisticLocking())
+ : false;
+ }
- return false;
+ private final boolean isExecuteWithOptimisticLockingIncludeUnversioned() {
+ Configuration configuration = configuration();
+
+ // This can be null when the current record is detached
+ return configuration != null
+ ? !TRUE.equals(configuration.settings().isExecuteWithOptimisticLockingExcludeUnversioned())
+ : true;
}
@SuppressWarnings("deprecation")
diff --git a/jOOQ/src/main/resources/xjb/binding.xjb b/jOOQ/src/main/resources/xjb/binding.xjb
index 38decef32f..4b9c0d9ea7 100644
--- a/jOOQ/src/main/resources/xjb/binding.xjb
+++ b/jOOQ/src/main/resources/xjb/binding.xjb
@@ -12,16 +12,16 @@
-
+
-
+
-
+
org.jooq.conf.SettingsBase
java.lang.Cloneable
diff --git a/jOOQ/src/main/resources/xsd/jooq-runtime-3.9.0.xsd b/jOOQ/src/main/resources/xsd/jooq-runtime-3.9.0.xsd
new file mode 100644
index 0000000000..becb083078
--- /dev/null
+++ b/jOOQ/src/main/resources/xsd/jooq-runtime-3.9.0.xsd
@@ -0,0 +1,278 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file