Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStubBase.java =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStubBase.java (revision 1439871) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStubBase.java (working copy) @@ -28,6 +28,7 @@ import javax.jcr.UnsupportedRepositoryOperationException; import org.apache.jackrabbit.mk.core.MicroKernelImpl; +import org.apache.jackrabbit.oak.plugins.index.old.mk.wrapper.LogWrapper; import org.apache.jackrabbit.test.NotExecutableException; import org.apache.jackrabbit.test.RepositoryStub; @@ -45,7 +46,7 @@ super(settings); String dir = "target/mk-tck-" + System.currentTimeMillis(); - Jcr jcr = new Jcr(new MicroKernelImpl(dir)); + Jcr jcr = new Jcr(new LogWrapper(new MicroKernelImpl(dir))); jcr.with(Executors.newScheduledThreadPool(1)); preCreateRepository(jcr); repository = jcr.createRepository(); Index: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepeatedRead.java =================================================================== --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepeatedRead.java (revision 0) +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepeatedRead.java (revision 0) @@ -0,0 +1,68 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.oak.jcr; + +import java.util.concurrent.atomic.AtomicBoolean; + +import javax.jcr.Node; +import javax.jcr.RepositoryException; +import javax.jcr.Session; + +import org.apache.jackrabbit.commons.iterator.NodeIterable; +import org.apache.jackrabbit.test.AbstractJCRTest; + +/** + * Repeatedly reads the same content while another thread modifies a node in + * a different location. + */ +public class RepeatedRead extends AbstractJCRTest { + + public void testRepeatedRead() throws Exception { + Node test = superuser.getRootNode().addNode("test"); + for (int i = 0; i < 10; i++) { + test.addNode("node-" + i); + } + Node tmp = superuser.getRootNode().addNode("tmp"); + superuser.save(); + final AtomicBoolean stop = new AtomicBoolean(false); + Thread reader = new Thread(new Runnable() { + @Override + public void run() { + while (!stop.get()) { + try { + Session s = getHelper().getSuperuserSession(); + Node test = s.getRootNode().getNode("test"); + for (Node child : new NodeIterable(test.getNodes())) { + child.getProperties(); + } + s.logout(); + } catch (RepositoryException e) { + e.printStackTrace(); + } + } + } + }); + reader.start(); + for (int i = 0; i < 20; i++) { + tmp.setProperty("prop", Math.random()); + superuser.save(); + } + stop.set(true); + reader.join(); + } + +} Property changes on: oak-jcr\src\test\java\org\apache\jackrabbit\oak\jcr\RepeatedRead.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Rev URL Added: svn:eol-style + native