db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Nitz ...@ukr.net>
Subject Re: superflous, long queries in CVS HEAD (Batch retrieval)
Date Mon, 06 Oct 2003 10:38:16 GMT
Hi Oliver,

I just like to understand what happens. Look, in the buildPrefetchQueries() 
method, line 150, I've added:

            fkValues = ord.getForeignKeyValues(owner,cld);
            if (isNull(fkValues))
            {
                continue;
            }

thus null fkValues will not be added to the list of fk values.
So in the associateBatched() after 

            fkValues = ord.getForeignKeyValues(owner,cld);

the condition "isNull(fkValues)" should be always false.
But in your example it sometimes happens to be true, right?
Do you have any ideas about how this can happen? 

Oleg

On Tuesday 30 September 2003 08:20, oliver.matz@ppi.de wrote:
> Hej Oleg,
>
> sorry that it took so much time to answer.
>
> > -----Original Message-----
> > From: Oleg Nitz [mailto:on@ukr.net]
> >
> > I've implemented your fix in another way, but I hope it still
> > works, please tell me if I'm right ;-)
>
> I have tried your fix, but the problem still exists.
> If ReferencePrefetcher, lines 108 ff look like this ...
>
>         while (iter.hasNext())
>         {
>             owner = iter.next();
>             fkValues = ord.getForeignKeyValues(owner,cld);
> //           if (!isNull(fkValues))
> //           {
>             id = new Identity(null, topLevelClass, fkValues);
>             relatedObject = pb.getObjectByIdentity(id);
>             field.set(owner, relatedObject);
> //           }
>         }
>
> ... this results in the following statements:
>
> sql: statement|SELECT CLASS_NAME,PARENT_FK,CHILD_FK,ID
>   FROM X_TABLE WHERE ID = '101'
> sql: statement|SELECT A0.CLASS_NAME,A0.PARENT_FK,A0.CHILD_FK,A0.ID
>   FROM X_TABLE A0 WHERE ( A0.PARENT_FK =  '101' ) AND
>                         (A0.CLASS_NAME =  'org.apache.ojb.broker.XB' )
> sql: statement|SELECT ID FROM XC_TABLE WHERE ID = ''
>
> If I uncomment if if-statement, the third statement
> is surpressed.  Do you think that whould do any harm?
>
> Olli
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message