diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java index 04cb56fef..5270142c1 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java @@ -338,9 +338,9 @@ public class PrimaryRow if (prev == NULL) prev = null; if (!rowValueEquals(prev, val)) { - if (allowsUpdate(col, prev, val)) { + if (isDefaultValue(prev) || allowsUpdate(col, prev, val)) { super.setObject(col, val, metaType, overrideDefault); - } else if (!isDefaultValue(val)) { + } else if (!isDefaultValue(prev)) { throw new InvalidStateException(_loc.get("diff-values", new Object[]{ col.getFullDBIdentifier().getName(), (prev == null) ? null : prev.getClass(), prev,