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 "Chetan Mehrotra (JIRA)" <ji...@apache.org> on 2017/07/26 06:46:01 UTC

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

    [ https://issues.apache.org/jira/browse/OAK-5173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16101235#comment-16101235 ] 

Chetan Mehrotra commented on OAK-5173:
--------------------------------------

[~tmueller] This error message has confused people few times. Can you have a look at proposed approach by [~alexander.klimetschek]

> 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, property-index
>    Affects Versions: 1.4.10, 1.5.14
>            Reporter: Alexander Klimetschek
>            Priority: Minor
>             Fix For: 1.8, 1.7.5
>
>
> 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.4.14#64029)