jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Adding child to node obatined from iterator doesn't work
Date Wed, 25 Jun 2008 14:14:41 GMT
Hi,

On Wed, Jun 25, 2008 at 5:03 PM, viz06 <vijaykumarsharma_1999@yahoo.com> wrote:
> QueryManager queryManager = this.jcrTemplate.getSessionFactory()
>            .getSession().getWorkspace().getQueryManager();
> Query jcrQuery = queryManager.createQuery(nodeSearchPath, Query.XPATH);
> NodeIterator nodeIterator =  jcrQuery.execute().getNodes();
> [...]
> this.jcrTemplate.save();

Looks like you are using two sessions here (i.e. you make changes in
the session returned by jcrTemplate.getSessionFactory().getSession(),
but save them using jcrTemplate.save()).

Try replacing the first statements with:

    NodeIterator nodeIterator =
        this.jcrTemplate.query(nodeSearchPath, Query.XPATH).getNodes();

BR,

Jukka Zitting

Mime
View raw message