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.

Reply via email to