Hi,
I am upgrading openmaint-2.0-3.2.1 to openmaint-2.1-3.3.1
openmaint starts and offers database patches but stops at patch 3.3.0-34_embedded_items
with Generic error:
Blockquoteorg.cmdbuild.dao.DaoException: error processing patch = Patch{version=3.3.0-34_embedded_items, category=core, applied=false}, caused by: org.cmdbuild.dao.DaoException: error processing patch =< core-3.3.0-34_embedded_items (embedded items) >, caused by: org.springframework.dao.DataIntegrityViolationException: StatementCallback; SQL [ SET SESSION cmdbuild.ignore_tenant_policies = ‘true’; SET SESSION cmdbuild.user_tenants = ‘{}’; DO $$ BEGIN RAISE NOTICE ‘apply cmdbuild patch %’, ‘core-3.3.0-34_embedded_items’; END $$ LANGUAGE PLPGSQL; – embedded items SELECT _cm3_class_create(‘NAME: _Items|MODE: reserved|TYPE: simpleclass|DESCR: Embedded Items Index’); SELECT _cm3_attribute_create(‘OWNER: _Items|NAME: Type|TYPE: varchar|NOTNULL: true’); SELECT _cm3_attribute_create(‘OWNER: _Items|NAME: OwnerClass|TYPE: regclass|NOTNULL: true’); SELECT _cm3_attribute_create(‘OWNER: _Items|NAME: Attr|TYPE: varchar|NOTNULL: true’); SELECT _cm3_attribute_create(‘OWNER: _Items|NAME: Card|TYPE: bigint|NOTNULL: true’); DO $$ BEGIN RAISE NOTICE ‘applied cmdbuild patch %’, ‘core-3.3.0-34_embedded_items’; END $$ LANGUAGE PLPGSQL; ]; ERROR: tuple to be updated was already modified by an operation triggered by the current command Hint: Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows. Where: SQL statement " WITH costants(description, notes, isactive) AS ( VALUES( public._cm3_class_comment_get(’"_Items"’, ‘DESCR’), (‘SUPERCLASS:’ || (public._cm3_class_is_superclass(’"_Items"’))::varchar || ‘|ANCHESTORS:’ || (SELECT array_agg(btrim(ancestors::text, ‘"’)) from public._cm3_class_ancestor_list(’"_Items"’) ancestors)::varchar)::varchar, coalesce(NULLIF(public._cm3_class_comment_get(’"_Items"’, ‘ACTIVE’),’’), ‘TRUE’)::boolean ) ) UPDATE public.“LookUp” SET “Description” = description, “Notes” = notes, “IsActive” = isactive FROM costants WHERE “Code” = btrim(’"_Items"’, ‘"’) AND (“Description” IS DISTINCT FROM description OR “Notes” IS DISTINCT FROM notes OR “IsActive” IS DISTINCT FROM isactive) AND “Status” = ‘A’; UPDATE public.“LookUp” SET “Index” = orderedlu.rn FROM (select row_number() OVER (order by “Description”) as rn, “Id”, “Description” from public.“LookUp” where “Status” =‘A’ and “Type” = ‘COMMON - Classlist’) as orderedlu WHERE orderedlu.“Id” = “LookUp”.“Id” and “Status” = ‘A’ AND “Index” != orderedlu.rn;" PL/pgSQL function tt_classlist_lookup_management() line 71 at EXECUTE SQL statement “COMMENT ON TABLE “_Items” IS ‘MODE: reserved|TYPE: simpleclass|DESCR: Embedded Items Index’” PL/pgSQL function _cm3_class_comment_set(regclass,jsonb) line 11 at EXECUTE SQL statement “SELECT _cm3_class_comment_set(_classe, (SELECT coalesce(jsonb_object_agg(key, value), ‘{}’::jsonb) FROM jsonb_each_text(_features) WHERE key IN (SELECT _cm3_class_comment_keys())))” PL/pgSQL function _cm3_class_features_set(regclass,jsonb) line 2 at PERFORM SQL statement “SELECT _cm3_class_features_set(_class, _features)” PL/pgSQL function _cm3_class_create(character varying,regclass,jsonb) line 25 at PERFORM PL/pgSQL function _cm3_class_create(character varying,jsonb) line 2 at RETURN PL/pgSQL function _cm3_class_create(character varying) line 3 at RETURN; nested exception is org.postgresql.util.PSQLException: ERROR: tuple to be updated was already modified by an operation triggered by the current command Hint: Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows. Where: SQL statement " WITH costants(description, notes, isactive) AS ( VALUES( public._cm3_class_comment_get(’"_Items"’, ‘DESCR’), (‘SUPERCLASS:’ || (public._cm3_class_is_superclass(’"_Items"’))::varchar || ‘|ANCHESTORS:’ || (SELECT array_agg(btrim(ancestors::text, ‘"’)) from public._cm3_class_ancestor_list(’"_Items"’) ancestors)::varchar)::varchar, coalesce(NULLIF(public._cm3_class_comment_get(’"_Items"’, ‘ACTIVE’),’’), ‘TRUE’)::boolean ) ) UPDATE public.“LookUp” SET “Description” = description, “Notes” = notes, “IsActive” = isactive FROM costants WHERE “Code” = btrim(’"_Items"’, ‘"’) AND (“Description” IS DISTINCT FROM description OR “Notes” IS DISTINCT FROM notes OR “IsActive” IS DISTINCT FROM isactive) AND “Status” = ‘A’; UPDATE public.“LookUp” SET “Index” = orderedlu.rn FROM (select row_number() OVER (order by “Description”) as rn, “Id”, “Description” from public.“LookUp” where “Status” =‘A’ and “Type” = ‘COMMON - Classlist’) as orderedlu WHERE orderedlu.“Id” = “LookUp”.“Id” and “Status” = ‘A’ AND “Index” != orderedlu.rn;" PL/pgSQL function tt_classlist_lookup_management() line 71 at EXECUTE SQL statement “COMMENT ON TABLE “_Items” IS ‘MODE: reserved|TYPE: simpleclass|DESCR: Embedded Items Index’” PL/pgSQL function _cm3_class_comment_set(regclass,jsonb) line 11 at EXECUTE SQL statement “SELECT _cm3_class_comment_set(_classe, (SELECT coalesce(jsonb_object_agg(key, value), ‘{}’::jsonb) FROM jsonb_each_text(_features) WHERE key IN (SELECT _cm3_class_comment_keys())))” PL/pgSQL function _cm3_class_features_set(regclass,jsonb) line 2 at PERFORM SQL statement “SELECT _cm3_class_features_set(_class, _features)” PL/pgSQL function _cm3_class_create(character varying,regclass,jsonb) line 25 at PERFORM PL/pgSQL function _cm3_class_create(character varying,jsonb) line 2 at RETURN PL/pgSQL function _cm3_class_create(character varying) line 3 at RETURN, caused by: org.postgresql.util.PSQLException: ERROR: tuple to be updated was already modified by an operation triggered by the current command Hint: Consider using an AFTER trigger instead of a BEFORE trigger to propagate changes to other rows. Where: SQL statement " WITH costants(description, notes, isactive) AS ( VALUES( public._cm3_class_comment_get(’"_Items"’, ‘DESCR’), (‘SUPERCLASS:’ || (public._cm3_class_is_superclass(’"_Items"’))::varchar || ‘|ANCHESTORS:’ || (SELECT array_agg(btrim(ancestors::text, ‘"’)) from public._cm3_class_ancestor_list(’"_Items"’) ancestors)::varchar)::varchar, coalesce(NULLIF(public._cm3_class_comment_get(’"_Items"’, ‘ACTIVE’),’’), ‘TRUE’)::boolean ) ) UPDATE public.“LookUp” SET “Description” = description, “Notes” = notes, “IsActive” = isactive FROM costants WHERE “Code” = btrim(’"_Items"’, ‘"’) AND (“Description” IS DISTINCT FROM description OR “Notes” IS DISTINCT FROM notes OR “IsActive” IS DISTINCT FROM isactive) AND “Status” = ‘A’; UPDATE public.“LookUp” SET “Index” = orderedlu.rn FROM (select row_number() OVER (order by “Description”) as rn, “Id”, “Description” from public.“LookUp” where “Status” =‘A’ and “Type” = ‘COMMON - Classlist’) as orderedlu WHERE orderedlu.“Id” = “LookUp”.“Id” and “Status” = ‘A’ AND “Index” != orderedlu.rn;" PL/pgSQL function tt_classlist_lookup_management() line 71 at EXECUTE SQL statement “COMMENT ON TABLE “_Items” IS ‘MODE: reserved|TYPE: simpleclass|DESCR: Embedded Items Index’” PL/pgSQL function _cm3_class_comment_set(regclass,jsonb) line 11 at EXECUTE SQL statement “SELECT _cm3_class_comment_set(_classe, (SELECT coalesce(jsonb_object_agg(key, value), ‘{}’::jsonb) FROM jsonb_each_text(_features) WHERE key IN (SELECT _cm3_class_comment_keys())))” PL/pgSQL function _cm3_class_features_set(regclass,jsonb) line 2 at PERFORM SQL statement “SELECT _cm3_class_features_set(_class, _features)” PL/pgSQL function _cm3_class_create(character varying,regclass,jsonb) line 25 at PERFORM PL/pgSQL function _cm3_class_create(character varying,jsonb) line 2 at RETURN PL/pgSQL function _cm3_class_create(character varying) line 3 at RETURN
Any ideas what the problem might be?
Thanks