-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 9.10
-
Fix Version/s: 9.10-HF28, 10.10-HF02, 11.1, 2021.0
-
Component/s: Core VCS
-
Release Notes Summary:The unique child name constraint takes into account the soft-delete feature.
-
Backlog priority:500
-
Sprint:nxFG 11.1.3
When soft-delete is enabled, it can cause an error at startup when document route definitions are imported:
ERROR [localhost-startStop-1] [org.nuxeo.osgi.OSGiAdapter] Error during Framework Listener execution: class org.nuxeo.runtime.osgi.OSGiRuntimeService org.nuxeo.ecm.core.api.ConcurrentUpdateException: Failed to save session, java.sql.BatchUpdateException: Batch entry 0 INSERT INTO "hierarchy" ("id", "parented", "pos", "name", "isproperty", "primarytype", "mixintypes", "ischeckedin", baseversionid", "majorversion", "minorversion", "isversion", "isretentionactive", systemchangetoken", "changetoken", "isdeleted", "deletedtime") VALUES ('4b6c2ec2-26e6-4ba4-a033-ebb58c50e650', '2e0bb739-c0a4-4468-bc1f-9e5a3150fa3c', NULL, 'ParallelDocumentreview', 'FALSE', 'DocumentRoute', '{"facet-var_ParallelDocumentReview"}', NULL, NULL, 0, 0, NULL, NULL, 0, 0, NULL, NULL) was aborted: ERROR: duplicate key value violates unique constraint "hierarchy_unique_child" Detail: Key (parented, name)=(2e0bb739-c0a4-4468-bc1f-9e5a3150fa3c, ParallelDocumentReview) already exists. Call getNextException to see other errors in the batch. at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection.checkConcurrentUpdate(JDBCConnection.java:184) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.insertSimpleRows(JDBCRowMapper.java:561) ... at org.nuxeo.ecm.platform.routing.core.persistence.RouteModelsZipImporter.create(RouteModelsZipImporter.java:97) ... at org.nuxeo.ecm.core.repository.RepositoryInitializationHandler.initializeRepository(RepositoryInitialtionHandler.java:93)
One solution could be not to import document route definitions if they have not changed since the last startup.
Otherwise a uniqueness constraint could be updated to test the column "isdeleted"
This applies only to PostgreSQL, which is the only VCS backend having constraints to ensure unique child names.
- depends on
-
NXP-22421 Database-level integrity constraints for PostgreSQL
- Resolved