diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c07ca181104f022b60cbf6d1896d3046d2c143f..4fede81ceb03b95dd8391641a702daa3e8eeebc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### +* Unexpected Server Error when inserting an Entity. + [#216](https://gitlab.com/caosdb/caosdb-server/-/issues/216) * Bad performance due to the execution of unnecessary jobs during retrieval. [#189](https://gitlab.com/caosdb/caosdb-server/-/issues/189) * Query Language: Parentheses change filter to subproperty filter diff --git a/src/main/java/org/caosdb/server/database/DatabaseUtils.java b/src/main/java/org/caosdb/server/database/DatabaseUtils.java index 47e8a9afe4fb2d81d40e71aff01c81ea314a26ca..5280de17d91982db0481105af8c9ca760db1384f 100644 --- a/src/main/java/org/caosdb/server/database/DatabaseUtils.java +++ b/src/main/java/org/caosdb/server/database/DatabaseUtils.java @@ -96,7 +96,11 @@ public class DatabaseUtils { && !p.isDatatypeOverride() && (!p.hasProperties() || hasUniquePropertyId(p, e)) && !(p.getDatatype() instanceof AbstractCollectionDatatype)) { - // if p has no sub-properties, just add it + // this property can be represented without any replacement. We explicitly + // setReplacement(null) because there is a corner case (related to the inheritance of + // properties) where there is a replacement present which belongs to the parent entity, see + // https://gitlab.com/caosdb/caosdb-server/-/issues/216. + p.setReplacement(null); } else { stage1Inserts.add(makeReplacement(p)); }