On Tuesday 01 December 2015 19:22:14 H K wrote: > Hi, > > Sure. In pseudocode, here it is: > > 1. Have Sling standalone running and have application that provides REST > service createChildFolder (for example sake). Application connects to > repository by using DocumentMK, as in the link from the OP post. > > 2. Call createChildFolder("pathToParent", "childName"). > > 3. Make GET request to http://localhost:8080/pathToParent.infinity.json > > 4. Inspecting the JSON Object, expect there to be a child node in parent > node but none are there. Test failed. > > However, if I let the thread sleep for 2 seconds after step 2, child exists > in the JSON as wanted.
It works without a sleep when running in an OSGi container using a NodeStore from DocumentNodeStoreService (test is based on SlingLaunchpadOakMongoIT). Non-OSGi setup with different NodeStore needs to be verified. Regards, O. > Thanks, > H > > > From: apa...@oliverlietz.de > > To: users@sling.apache.org > > Subject: Re: Sling retrieving out-of-date data > > Date: Tue, 1 Dec 2015 19:49:20 +0100 > > > > On Tuesday 01 December 2015 11:37:42 H K wrote: > > > Hi, > > > > Hi, > > > > > I'm currently using the Sling 8 standalone and it's connected to a > > > MongoDB > > > database. I've got an application which also connects to the same > > > MongoDB > > > database and writes/reads from it. The connection is done using > > > DocumentMK, > > > following the instructions at > > > https://jackrabbit.apache.org/oak/docs/construct.html > > > > > > My problem is that when I write data to the repository through my > > > application, Sling does not seem to get it fast enough, which may be > > > because it is caching or because it only periodically checks to see if > > > the > > > data it has is up-to-date or not. For instance in my unit tests that > > > test > > > some of my REST services, I'm creating a child node somewhere and then > > > doing a GET request to Sling to get back a JSON representing the updated > > > parent. However, the returned result does not have the child in it. I > > > know > > > the changes are made because if I delay for two seconds before > > > submitting > > > the GET request, all works fine. > > > > > > This was not a problem using Sling 7 with Jackrabbit (instead of Oak) > > > and > > > connecting over RMI. > > > > > > Can someone provide some insight and/or a solution? Thanks! > > > > can you provide a minimal test case which resembles what you are doing? > > > > Regards, > > O.