You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Behrang Saeedzadeh <be...@gmail.com> on 2014/12/02 10:33:18 UTC

Eager loading nodes and properties when executing a query

Hi,

I am still searching for potential solutions to avoid the
InvalidItemStateException I discussed in my previous email.

Is there a way to configure Jackrabbit (inside CQ5 using TarPM) to eagerly
load the nodes as well as their properties when executing a query?

For example

    final Session session = resourceResolver.adaptTo(Session.class);
    final QueryManager queryManager =
session.getWorkspace().getQueryManager();
    final Query query = queryManager.createQuery("", Query.JCR_SQL2);
    final QueryResult queryResult = query.execute();

In the fourth line, I want queryResult to be preloaded with the nodes with
their properties prefetched, so that if while I am iterating through
the returned nodes one or more of them are deleted from the repository or
have the value of their properties changed or properties
deleted if won't affect me or break with IISE exceptions.

Is this possible?

Best regards,
Behrang
http://www.behrang.org