You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Alexander Klimetschek (JIRA)" <ji...@apache.org> on 2016/11/28 23:07:58 UTC

[jira] [Created] (OAK-5173) Path in uniqueness constraint violation exception is always the root

Alexander Klimetschek created OAK-5173:
------------------------------------------

             Summary: Path in uniqueness constraint violation exception is always the root
                 Key: OAK-5173
                 URL: https://issues.apache.org/jira/browse/OAK-5173
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: core
    Affects Versions: 1.5.14, 1.4.10
            Reporter: Alexander Klimetschek
            Priority: Minor


OAK-1997 added a (single) path to the uniqueness constraint exception message in the PropertyIndexEditor to point out where the duplicate came from, but it is always the root:

{noformat}
OakConstraint0030: Uniqueness constraint violated at path [/] for one of the property in [rep:externalId] having value xyz1234
{noformat}

That is because it [uses getPath()|https://github.com/apache/jackrabbit-oak/blob/3a88b23d51beae4798e9b29c4deaba81c81fb427/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexEditor.java#L315-L318] of the index editor itself and the uniqueness check always [happens at the root level|https://github.com/apache/jackrabbit-oak/blob/3a88b23d51beae4798e9b29c4deaba81c81fb427/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/property/PropertyIndexEditor.java#L303] at the end.

It probably has to read from the index to find out the 2 or more paths with the same property value (just printing one path is not enough information for duplicates).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)