-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 9.3
-
Sprint:nxcore 9.3.7
-
Story Points:0
AgendaOperationsTest fails on PostgreSQL when two documents are created in the same millisecond, due to database-level constraints (NXP-22421).
The code should use a unique random name instead of using "null" and relying on the DuplicatedNameFixer.
org.nuxeo.ecm.core.api.ConcurrentUpdateException: java.sql.BatchUpdateException: Batch entry 4 INSERT INTO "hierarchy" ("id", "parentid", "pos", "name", "isproperty", "primarytype", "mixintypes", "ischeckedin", "baseversionid", "majorversion", "minorversion", "isversion", "systemchangetoken", "changetoken") VALUES ('e36b4801-c474-4725-9f0d-19fb4183ecd5', 'e8ee3b63-5bed-41a4-b986-16eb047933e0', NULL, 'null.1506783917550', 'FALSE', 'VEVENT', NULL, NULL, NULL, 0, 0, NULL, 0, 0) was aborted: ERROR: duplicate key value violates unique constraint "hierarchy_unique_child" Detail: Key (parentid, name)=(e8ee3b63-5bed-41a4-b986-16eb047933e0, null.1506783917550) 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.core.storage.sql.jdbc.JDBCRowMapper.writeCreates(JDBCRowMapper.java:471) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.write(JDBCRowMapper.java:444) at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doInvoke(JDBCMapperConnector.java:111) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.lambda$doConnectAndInvoke$0(JDBCMapperConnector.java:98) at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:589) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.doConnectAndInvoke(JDBCMapperConnector.java:95) at org.nuxeo.ecm.core.storage.sql.jdbc.JDBCMapperConnector.invoke(JDBCMapperConnector.java:84) at com.sun.proxy.$Proxy45.write(Unknown Source) at org.nuxeo.ecm.core.storage.sql.SoftRefCachingRowMapper.write(SoftRefCachingRowMapper.java:360) at org.nuxeo.ecm.core.storage.sql.SessionImpl.doFlush(SessionImpl.java:369) at org.nuxeo.ecm.core.storage.sql.SessionImpl.flush(SessionImpl.java:342) at org.nuxeo.ecm.core.storage.sql.SessionImpl.end(SessionImpl.java:1464) at org.apache.geronimo.transaction.manager.WrapperNamedXAResource.end(WrapperNamedXAResource.java:61) at org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:569) at org.apache.geronimo.transaction.manager.TransactionImpl.endResources(TransactionImpl.java:548) at org.apache.geronimo.transaction.manager.TransactionImpl.beforePrepare(TransactionImpl.java:408) at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:255) at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:252) at org.nuxeo.runtime.jtajca.NuxeoContainer$UserTransactionImpl.commit(NuxeoContainer.java:539) at org.nuxeo.runtime.transaction.TransactionHelper.commitOrRollbackTransaction(TransactionHelper.java:363) at org.nuxeo.ecm.agenda.operations.AgendaOperationsTest.testListEventsWithLimit(AgendaOperationsTest.java:144)
- depends on
-
NXP-22421 Database-level integrity constraints for PostgreSQL
- Resolved