Okie that explains. The query is most likely using a Lucene indexes which
are asynchronously updated (5 sec runs). So if you perform any content
update then it would take some time for them to reflect in query result

If you cannot switch to direct access then you need to ensure that query is
based on property index

regards
Chetan

Chetan Mehrotra

On Wed, May 25, 2016 at 1:56 PM, Loicram Kro <[email protected]> wrote:

> AEM,
>
> Yes, we execute a questy which finds the resource by a property which was
> already saved on a resource (even before the first request)
>
> On 25 May 2016 at 05:18, Chetan Mehrotra <[email protected]>
> wrote:
>
> > To be sure is your application is based on AEM or just a custom Sling
> based
> > app?
> >
> > When you are performing a read is that preceded by invoking a query to
> find
> > the resource?
> >
> > Chetan Mehrotra
> >
> > On Tue, May 24, 2016 at 9:05 PM, Loicram Kro <[email protected]>
> > wrote:
> >
> > > I don't create it explictly, it is created with the request.
> > >
> > > I'm taking ResourceResolver from SlingHttpServletRequest
> > > I'm doing my changes on a resource (Resource is found by property,
> which
> > > doesn't change, query is executed using ResourceResolver#findResources)
> > > I'm commiting changes with resourceResolver.commit() method
> > >
> > > When I try to read the saved properties, I do exactly the same steps. I
> > > find the page resource by the same property, and I'm trying to read
> > values
> > > using value map.
> > >
> > > On 6.0 with jackrabbit2 it was working fine.
> > >
> > > Regards
> > >
> > > On 24 May 2016 at 14:57, Chetan Mehrotra <[email protected]>
> > > wrote:
> > >
> > > > Then it should work as you expect. Can you share some code around how
> > you
> > > > create the JCR Session and perform the read/write operation
> > > >
> > > > Chetan Mehrotra
> > > >
> > > > On Tue, May 24, 2016 at 4:57 PM, Loicram Kro <[email protected]>
> > > > wrote:
> > > >
> > > > > It is a single node (author) with TarMK
> > > > >
> > > > > On 24 May 2016 at 12:15, Chetan Mehrotra <
> [email protected]>
> > > > > wrote:
> > > > >
> > > > > > Is it a single node setup or a cluster? What is the persistence
> > used
> > > > > TarMK
> > > > > > or MongoMK
> > > > > >
> > > > > > Chetan Mehrotra
> > > > > >
> > > > > > On Tue, May 24, 2016 at 3:11 PM, Loicram Kro <
> > [email protected]>
> > > > > > wrote:
> > > > > >
> > > > > > > Hi.
> > > > > > >
> > > > > > > I'm using oak in version 1.2.11.
> > > > > > > I have a problem with visibility of changes in new sessions.
> > > > > > > Steps which I do:
> > > > > > > 1. Send a request to save some changes (changes are saved by
> OSGI
> > > > > > Service)
> > > > > > > 2. Changes are saved and response is sent back
> > > > > > > 3. I send new request which tries to read the changes from the
> > > > previous
> > > > > > > request
> > > > > > > 4. Changes are not visible
> > > > > > >
> > > > > > > I read in the docs, that Oak for each new session is taking a
> > > > > repository
> > > > > > > snapshot. From what I've understood, changes from the point
> > number
> > > > one,
> > > > > > may
> > > > > > > not be visible for sessions which were already created, but
> they
> > > will
> > > > > be
> > > > > > > visible for new sessions.
> > > > > > > I've tried to refresh the Session, by calling refresh(false) on
> > > > Session
> > > > > > > object, but usually changes are still not visible.
> > > > > > > Of course if I will wait 2-3 second between those requests then
> > > > > > everything
> > > > > > > is fine, but that is not possible in my case.
> > > > > > >
> > > > > > > I assume that save is not done when immediately, and still
> > > something
> > > > is
> > > > > > > happening in the background (maybe there are some default
> commit
> > > > hooks,
> > > > > > > which need some time to process).
> > > > > > >
> > > > > > > It's time for questions:
> > > > > > > 1. Is it proper behaviour ? That I don't see changes from
> > previous
> > > > > > request
> > > > > > > in the new request?
> > > > > > > 2. If yes, how can I get those changes? I mean, i know that I
> can
> > > do
> > > > > > > everything in one request, so I will see my changes, but maybe
> > > there
> > > > > is a
> > > > > > > way to get those changes for example from repository directly?
> I
> > > > > couldn't
> > > > > > > find any information how to do that.
> > > > > > >
> > > > > > > I will just add, that all the time I have short term sessions.
> > > > > (requests
> > > > > > > goes to sling servlet, which pass the request to OSGI Service).
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to