1 Reply Latest reply on Jul 20, 2017 7:22 AM by prinzs

    Change successor of node using db persistence

    prinzs

      Due to an error in our application a node got currupted. The version graph of the node has two versions named "1.0". The rootVersion.successor points to one of the "1.0" versions. We want to delete the other (useless) version 1.0.

       

      The problem is, that we can not delete this version, because it tells us, that the version is still referenced by the rootVersion.

      However, when we get the rootVersion via the versionManager, the id of the version we are trying to get rid of is not present as successor.

      So we tried to debug the deletion process of the version and in "WriteableSessionCache.persistChanges" we could see that the call "translator.getReferrers(doc, ReferenceType.STRONG);" returns the rootVersion and therefore the deletion process fails with a ReferentialIntegrityException.

       

      Can you please tell us, how to manipulate the persisted node, so that we can delete the wrong successor from the version?

       

      Thanks

      Simon

       

       

      EDIT:

      This is the rootVersion entry in the postgres db:

      "46f36ba317f1e75638a556-5e78-4c0a-b394-87b16dd16b36";"2017-07-19 16:04:50.570796";"\263\002\000\000\003metadata\000@\000\000\000\002id\0003\000\000\00046f36ba317f1e75638a556-5e78-4c0a-b394-87b16dd16b36\000\000\003content\000[\002\000\000\002key\0003\000\000\00046f36ba317f1e75638a556-5e78-4c0a-b394-87b16dd16b36\000\002parent\0003\000\000\00046f36ba317f1e7e017b74e-4520-493d-8c63-3a7b94f622dd\000\003properties\000\264\000\000\000\003http://www.jcp.org/jcr/1.0\000\223\000\000\000\002uuid\000%\000\000\0005638a556-5e78-4c0a-b394-87b16dd16b36\000\003primaryType\000\033\000\000\000\002$name\000\013\000\000\000nt:version\000\000\003created\000.\000\000\000\002$date\000\036\000\000\0002017-07-19T08:25:53.929+02:00\000\000\000\000\004children\000b\000\000\000\0030\000Z\000\000\000\002key\0003\000\000\00046f36ba317f1e788d1e75c-96a6-4b1c-83b1-36492b2ebd42\000\002name\000\017\000\000\000jcr:frozenNode\000\000\000\003childrenInfo\000\024\000\000\000\022count\000\001\000\000\000\000\000\000\000\000\003referrers\000\202\000\000\000\003strong\000u\000\000\000\02046f36ba317f1e7b5b5e1a6-f8c8-43d5-9995-616a0a25b016\000\001\000\000\000\02046f36ba317f1e7c6d5698b-81e9-4929-b00d-622260aebcca\000\001\000\000\000\000\000\000\000"

       

      We can see the successor id of the node which we want to delete ('46f36ba317f1e7c6d5698b-81e9-4929-b00d-622260aebcca') and the true successor ('46f36ba317f1e7b5b5e1a6-f8c8-43d5-9995-616a0a25b016'). Can you provide us with information on how to read the bytea data and remove the wrong successor from the db?

      Or is there a different way to reliably remove the successor of the version node?