diff --git a/jOOQ/src/main/java/org/jooq/exception/DataChangedException.java b/jOOQ/src/main/java/org/jooq/exception/DataChangedException.java
index bcd1502e2c..a9aef32ff4 100644
--- a/jOOQ/src/main/java/org/jooq/exception/DataChangedException.java
+++ b/jOOQ/src/main/java/org/jooq/exception/DataChangedException.java
@@ -40,8 +40,17 @@ package org.jooq.exception;
import org.jooq.UpdatableRecord;
/**
- * An error occurred while storing a record whose underlying data had already
- * been changed
+ * An error occurred while storing a record with optimistic locking active,
+ * whose underlying data had already been changed.
+ *
+ * This exception may be thrown if:
+ *
+ * - The record has been changed.
+ * - The record has been removed.
+ * - It isn't possible to detect whether the record has been changed (e.g.
+ * because {@link UpdatableRecord#update()} is called on a record that hasn't
+ * been previously fetched from the database).
+ *
*
* @see UpdatableRecord#store()
* @author Lukas Eder
diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java
index 1ae1af4829..dcfce8cf2f 100644
--- a/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java
+++ b/jOOQ/src/main/java/org/jooq/impl/UpdatableRecordImpl.java
@@ -504,7 +504,10 @@ public class UpdatableRecordImpl> extends TableReco
Object thatObject = record.original(field);
if (!StringUtils.equals(thisObject, thatObject))
- throw new DataChangedException("Database record has been changed");
+ if (thisObject == null && !fetched)
+ throw new DataChangedException("Cannot detect whether unversioned record has been changed. Either make sure the record is fetched from the database, or use a version or timestamp column to version the record.");
+ else
+ throw new DataChangedException("Database record has been changed");
}
}