You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Neil <nc...@hotmail.com> on 2011/01/24 15:50:11 UTC

ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Jackrabbit 2.2.1 / Tomcat 6.0

After upgrading to Jackrabbit 2.2.1 ( with hopes of increasing query
performance ) , we get the following error running what seems to be this
simple query: 

SELECT * FROM [ths:file] as file LEFT OUTER JOIN [ths:name] as names ON
ISDESCENDANTNODE(names,file) WHERE (upper(names.[ths:firstName]) = 'JUSTIN') 

The following exception is returned:

org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set
to 1024
       at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:163)
       at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:154)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getDescendantNodeQuery(LuceneQueryFactory.java:421)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:399)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.addBooleanConstraint(LuceneQueryFactory.java:501)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.addBooleanConstraint(LuceneQueryFactory.java:496)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.getOrQuery(LuceneQueryFactory.java:479)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.create(LuceneQueryFactory.java:378)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.mapConstraintToQueryAndFilter(LuceneQueryFactory.java:365)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.mapConstraintToQueryAndFilter(LuceneQueryFactory.java:313)
       at
org.apache.jackrabbit.core.query.lucene.LuceneQueryFactory.execute(LuceneQueryFactory.java:189)
       at
org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:222)
       at
org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:137)
       at
org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:184)
       at
org.apache.jackrabbit.core.query.lucene.join.QueryEngine.execute(QueryEngine.java:147)
       at
org.apache.jackrabbit.core.query.QueryObjectModelImpl.execute(QueryObjectModelImpl.java:114)
       at com.ths.server.dao.FileDao.findBySQLQuery(FileDao.java:394)
       at com.ths.server.dao.FileDao.searchFilesByCriteria(FileDao.java:160)
       at
com.ths.server.servlets.FileSearchServiceImpl.searchByCriteria(FileSearchServiceImpl.java:45)


The query worked when we were using Jackrabbit 2.1.0. Any suggestions or
help would be greatly appreciated.

Thanks in advance,
     Neil
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/ISDESCENDANTNODE-Sql2-query-fails-in-Jackrabbit-2-2-1-tp3234156p3234156.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: AW: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by Neil <nc...@hotmail.com>.
FWIW, this xpath query works: 

//element(*,ths:file)[./*/*/ths:lastName='KANE']
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/SOLVED-ISDESCENDANTNODE-Sql2-query-fails-in-Jackrabbit-2-2-1-tp3234156p3304989.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: AW: AW: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by Neil <nc...@hotmail.com>.
I am using 2.2.1. 

Oh well, re-writing my queries in X-Path.
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/SOLVED-ISDESCENDANTNODE-Sql2-query-fails-in-Jackrabbit-2-2-1-tp3234156p3305566.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

AW: AW: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by "Cech. Ulrich" <Ul...@aeb.de>.
< I thought everything was working well, but once I had more data in my system I started getting the max clause count exception.>
This bug was introduced in 2.2.2, we are facing the same problem.
I stepped back to version 2.2.1, there the queries worked.

Re: AW: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by Neil <nc...@hotmail.com>.
I am beginning to wonder if there is something wrong with the Query Builders.
This very simple SQL2 query is very important to my product. I was able to
successfully run the query after using the getRows() code from the iterator.

I thought everything was working well, but once I had more data in my system
I started getting the max clause count exception. So, I started to increase
the max clause count and retest. The query would run very slow and then
finally it would throw another max clause count exception with the new
increased value.

I am only 2 days from doing an install and I cannot query on just 310 nodes.
Is there any insight someone can provide? I am more than willing supply my
cnd if necessary. I noticed there is another thread addressing the max
clause count.
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/SOLVED-ISDESCENDANTNODE-Sql2-query-fails-in-Jackrabbit-2-2-1-tp3234156p3304948.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: AW: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by Jukka Zitting <jz...@adobe.com>.
Hi,

On 01/29/2011 09:27 PM, Neil wrote:
> I did have to change my query to an INNER join. The LEFT OUTER join
> caused every record to return. The fact that it worked in 2.1.0 as
> the LEFT OUTER was surprising to us when we originally wrote it. It
> seemed counter intuitive.
>
> Now that 2.2.x has been implemented it works the way it really should
> and that is with the INNER join.

Yep. Our join query engine underwent a fairly extensive rewrite before 
2.2. We did this mostly for performance reasons, but a number of bugs 
got fixed also along the way.

-- 
Jukka Zitting

Re: AW: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by Neil <nc...@hotmail.com>.
I figured it out.

My query does have multiple selectors ( files and names). Since it has
multiple selectors, I needed to use the RowIterator and not the
NodeIterator. With the RowIterator you can have multiple selectors.

I did have to change my query to an INNER join. The LEFT OUTER join caused
every record to return. The fact that it worked in 2.1.0 as the LEFT OUTER
was surprising to us when we originally wrote it. It seemed counter
intuitive.

Now that 2.2.x has been implemented it works the way it really should and
that is with the INNER join.

Hopefully this helps others.
-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/SOLVED-ISDESCENDANTNODE-Sql2-query-fails-in-Jackrabbit-2-2-1-tp3234156p3246529.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

AW: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by "Cech. Ulrich" <Ul...@aeb.de>.
Hi Neil,

we ran into the same error today.

Is there any option to set the maxClauseCount() while forming the sql2-query?

Thanks in advance,
Ulrich


Re: ISDESCENDANTNODE Sql2 query fails in Jackrabbit 2.2.1

Posted by Neil <nc...@hotmail.com>.
As a follow up, "ths:file" is an "nt:folder". "ths:name" is "nt:base".  The
"ths:name" is a child node of "ths:file". The "ths:name" node contains
properties that make up a persons name.

We upgraded to Jackrabbit 2.2.1 after reading over Issue JCR-2835. 

-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/ISDESCENDANTNODE-Sql2-query-fails-in-Jackrabbit-2-2-1-tp3234156p3236199.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.