Hi,

did some checking myself with 'native' PB API and you're right, it does
work.

Checked my wrapper and it did construct a criteria object with some self
reference in it, thats why it kept on recursing.

Sorry for the panic. (It is strange though that an older version of OJB did
handle this right).

Roger Janssen 
iBanx   



-----Original Message-----
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED]]
Sent: donderdag 21 november 2002 10:26
To: OJB Users List
Subject: Re: OJB hangs in recursive loop : stackoverflow


hi roger,

i tested the nested criteria witout any problem using the latest from
repository:

Criteria crit = new Criteria();
crit.addEqualTo("name", "Bräuchi");
Criteria crit2 = new Criteria();
crit2.addEqualTo("vorname", "Jakob");
Criteria crit3 = new Criteria();
crit3.addEqualTo("vorname", "Christof");
Criteria crit4 = new Criteria();
crit4.addEqualTo("vorname", "Reto");
crit2.addOrCriteria(crit3);
crit2.addOrCriteria(crit4);
crit.addAndCriteria(crit2);

Query query = new QueryByCriteria(Person.class, crit);
broker.getCollectionByQuery(query);

SELECT
A0.isBoss,A0.gebDat,A0.idTest,A0.entryDate,A0.adresse,A0.idPartner,A0.name,A
0.test,A0.vorname,A0.id FROM tabPerson A0 WHERE ( A0.name = ? ) AND
(A0.vorname = ? OR A0.vorname = ? OR A0.vorname = ? )

jakob

----- Original Message -----
From: "Janssen, Roger" <[EMAIL PROTECTED]>
To: "OJB User List (E-mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 3:03 PM
Subject: BUG: OJB hangs in recursive loop : stackoverflow


> Hi,
>
> i'm using OJB 0.9.7
>
> when i build a where-clause like this:
>               attribute1='X' and (attribute2='Y1' or attribute2='Y2' or
> attribute2='Y3')
> then OJB components seem to go into an infinite recursive loop (eventually
> resulting in a stackoverflow).
>
> pseudocode:
> -----------------------------------------------
>     Criteria crit = new Criteria();
>     crit.addEqualTo(attr1, X);
>
>     Criteria crit2 = new Criteria();
>     crit2.addEqualTo(attr2, Y1);
>     Criteria crit3 = new Criteria();
>     crit3.addEqualTo(attr2, Y2);
>     Criteria crit4 = new Criteria();
>     crit4.addEqualTo(attr2, Y3);
>
>     crit2.addOrCriteria(crit3);
>     crit2.addOrCriteria(crit4);
>
>     crit.addCriteria(crit2);
> ----------------------------------------------
>
> when i build a where-clause like this:
>               (attribute2='Y1' or attribute2='Y2' or attribute2='Y3')
> then there is no problem.
>
> So the combination of a single criterium 'AND'ed with a set of 'OR'ed
> criteria results in the stackoverflow.
>
> Note: this does NOT happen in version 0.8.375 (i tested on older release
of
> my application that used this OJB version).
>
> Part of the trace of my junit-testclass:
>
>     [junit] java.lang.StackOverflowError
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     [junit]  at
>
org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement.buildJoinTree(Unknow
> n Source)
>     ..................... (this goes on and on and on and
> on)......................................................................
>
>
> I also entered this bug in scarab, don't know what is best, either mail
it,
> log it in scarab, both.... what is best?
>
> Roger Janssen
> iBanx
>
>
> *************************************************************************
> The information contained in this communication is confidential and is
> intended solely for the use of the individual or entity to  whom it is
> addressed.You should not copy, disclose or distribute this communication
> without the authority of iBanx bv. iBanx bv is neither liable for
> the proper and complete transmission of the information has been
maintained
> nor that the communication is free of viruses, interceptions or
interference.
>
> If you are not the intended recipient of this communication please return
> the communication to the sender and delete and destroy all copies.
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to