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

Manuel Lara commented on OAK-8393:
----------------------------------

I tried to make a non osgi version but had no luck, it gets too complicated as 
this class relies heavily on osgi features. As you said it is like the changes 
are not actually commited to the database (I am calling dispose), now it is 
failing now in reading the clusterId, but the real bug here is that changes are 
not reflected in database. Can you provide a non osgi functional implementation?

> Oak won't work on PGSQL, keeps reindexing and fails
> ---------------------------------------------------
>
>                 Key: OAK-8393
>                 URL: https://issues.apache.org/jira/browse/OAK-8393
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>    Affects Versions: 1.12.0
>            Reporter: Manuel Lara
>            Priority: Blocker
>
> 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)

Reply via email to