jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandru Popescu" <the.mindstorm.mailingl...@gmail.com>
Subject Re: IndexOutOfBoundsException in QueryImpl.execute
Date Wed, 17 May 2006 16:44:21 GMT
I've checked with the guy who said he can reproduce it, and what I
presented before is generating the exception in our environment.

public class QueryExecutor {
     public void doInJcr(Session session) {
          for(int i= 0; i < 1000; i++) {
          QueryManager queryMgr = session.getWorkspace().getQueryManager();
          Query query = queryMgr.createQuery(queryString, Query.XPATH);
          NodeIterator iterator = query.execute().getNodes();
         }
    }
}

ThreadA has sessionA and calls QueryExecutor.doInJcr
ThreadB has a sessionB and calls QueryExecutor.doInJcr

The exception is thrown quite soon.

./alex
--
.w( the_mindstorm )p.




On 5/17/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com> wrote:
> Inside our application it looks like we are able to reproduce it, but
> I am not sure how to extract a testcase. Here is a short summary of
> how we can reproduce it:
>
> a method that executes a query a hundred of times and 2 parallel
> threads. Finally this results in the provided exception.
>
> The code of our method is quite standard:
>
> [code]
> publi void doInJcr(Session session) {
> QueryManager queryMgr = session.getWorkspace().getQueryManager();
> Query query = queryMgr.createQuery(queryString, Query.XPATH);
> NodeIterator iterator = query.execute().getNodes();
> }
> [/code]
>
> I reconfirm that the session is always a new one obtained through
> repository.login().
>
> And weirdly enough: the content is not modified when this occurs. The
> problem occurs in a piece of our product that does NO writes.  We have
> a single writting point which is synchronized. And as I mentioned,
> when this exception occurs there are definitely no writes around.
>
> Please help. I am starting to pull out my hair because this renders
> unusable a whole application.
>
> many many thanks,
>
> ./alex
> --
> .w( the_mindstorm )p.
>
>
> On 5/17/06, Jukka Zitting <jukka.zitting@gmail.com> wrote:
> > Hi,
> >
> > On 5/17/06, Alexandru Popescu <the.mindstorm.mailinglist@gmail.com> wrote:
> > > This looks like serious problem in multi-thread application. I am
> > > getting the feeling that this is happening when 2 threads are
> > > executing the same Query. And I am 1000% that each thread has its own
> > > javax.jcr.Session, so the problem looks to be somewhere deeper.
> >
> > Can you distill the problem into a standalone test case? The problem
> > sounds quite serious, but I couldn't replicate it with a quick test
> > case. Does it only happen when content is concurrently being modified?
> >
> > BR,
> >
> > Jukka Zitting
> >
> > --
> > Yukatan - http://yukatan.fi/ - info@yukatan.fi
> > Software craftsmanship, JCR consulting, and Java development
> >
>

Mime
View raw message