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 "Julian Reschke (JIRA)" <ji...@apache.org> on 2019/07/08 12:08:00 UTC

[jira] [Updated] (OAK-8393) Simplify use of DocumentNodeStore without OSGi

     [ https://issues.apache.org/jira/browse/OAK-8393?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Reschke updated OAK-8393:
--------------------------------
    Summary: Simplify use of DocumentNodeStore without OSGi  (was: Oak won't work on PGSQL, keeps reindexing and fails)

> Simplify use of DocumentNodeStore without OSGi
> ----------------------------------------------
>
>                 Key: OAK-8393
>                 URL: https://issues.apache.org/jira/browse/OAK-8393
>             Project: Jackrabbit Oak
>          Issue Type: Wish
>          Components: documentmk
>    Affects Versions: 1.12.0
>            Reporter: Manuel Lara
>            Priority: Minor
>
> Hi,
> I've been working with Oak using SegmentNodeStore without problems on transient repos.
> Recently I have the requirement to set up a persistent repository on PGSQL. This is the snippet:
>  
> {code:java}
> PlatformDBSM dbms = ctx.getBean(PlatformDBSM.class);
> RDBOptions options = new RDBOptions().dropTablesOnClose(false).tablePrefix("oak_");
> DocumentNodeStore ns = RDBDocumentNodeStoreBuilder.newRDBDocumentNodeStoreBuilder()
> .setRDBConnection(dbms.getDataSource(), options)
> .build();
> Repository repo = new Jcr(new Oak(ns)).createRepository();
> {code}
> When the tables are not present in the database Oak will create them correctly and the repo works ok. However if I run this code for a second time it will crash because it is always forcing a reindex for some reason, and it either complaints about node types definitions not being consistent or conflicts:
> {code:java}
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 9:/oak:index/nodetype/:index/rep%3AChildNodeDefinitions/jcr:system/jcr:nodeTypes/rep:NodeType/rep:namedChildNodeDefinitions/rep:namedChildNodeDefinitions was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 9:/oak:index/nodetype/:index/rep%3AChildNodeDefinitions/jcr:system/jcr:nodeTypes/rep:NodeType/rep:namedChildNodeDefinitions/jcr:childNodeDefinition was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 9:/oak:index/nodetype/:index/rep%3AChildNodeDefinitions/jcr:system/jcr:nodeTypes/rep:NodeType/rep:namedChildNodeDefinitions/jcr:propertyDefinition was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 7:/oak:index/nodetype/:index/rep%3AChildNodeDefinitions/jcr:system/jcr:nodeTypes/rep:root was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 8:/oak:index/nodetype/:index/rep%3AChildNodeDefinitions/jcr:system/jcr:nodeTypes/rep:root/rep:residualChildNodeDefinitions was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 8:/oak:index/nodetype/:index/rep%3AChildNodeDefinitions/jcr:system/jcr:nodeTypes/rep:root/rep:namedChildNodeDefinitions was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 9:/oak:index/nodetype/:index/rep%3AChildNodeDefinitions/jcr:system/jcr:nodeTypes/rep:root/rep:namedChildNodeDefinitions/jcr:system was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 2:/oak:index/counter was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 2:/oak:index/uuid was already added in revision
> r16b2de339a5-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1, org.apache.jackrabbit.oak.plugins.document.ConflictException: The node 3:/oak:index/uuid/:index was already added in revision
> r16b2de3b67f-0-1 (older than base r16b2e6567db-0-1,r16b2e4bae94-0-2), before
> r16b2e65a3ef-0-1]
> at org.apache.jackrabbit.oak.plugins.document.Commit.checkConflicts(Commit.java:640)
> at org.apache.jackrabbit.oak.plugins.document.Commit.applyToDocumentStore(Commit.java:366)
> at org.apache.jackrabbit.oak.plugins.document.Commit.applyToDocumentStoreWithTiming(Commit.java:280)
> at org.apache.jackrabbit.oak.plugins.document.Commit.applyToDocumentStore(Commit.java:264)
> at org.apache.jackrabbit.oak.plugins.document.Commit.applyInternal(Commit.java:232)
> at org.apache.jackrabbit.oak.plugins.document.Commit.apply(Commit.java:220)
> at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:318)
> at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.persist(DocumentNodeStoreBranch.java:282)
> at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.access$500(DocumentNodeStoreBranch.java:56)
> at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch$InMemory.merge(DocumentNodeStoreBranch.java:546)
> at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreBranch.merge0(DocumentNodeStoreBranch.java:196)
> ... 36 common frames omitted
> {code}
> It also happens on a newly created repo when trying to connect to it (run the code) for a second time.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)