Yes, you are correct.  I didn't look closely enough at 
the code.  It does seem to be a bug. The get${relCol}() 
method should always return all related records from 
the table.

I think there is a simpler solution to the problem.  
The method should not be wrapped in an if statement.
Instead it should just call the get${relCol}(Criteria)
method all the time.  The logic in the called method
(which was what I looked at) will return the cache if 
the criteria's match, or do a new query for all records
if they don't.

Please open up an issue on scarab for this bug. 

> -----Original Message-----
> From: Andrea Papotti 
> 
> Greg Monroe ha scritto:
> 
> >I suggest updating to version 3.2.  I looked at the
> >forgiegn key collection code generated by this 
> >version and it does check to see if the criteria 
> >has changed.  I suspect it was one of the bugs 
> >fixed.
> >  
> >
>  From 3.2's
> 
> <snip>
>     public List get${relCol}()
>       #if ($silentDbFetch)
>         throws TorqueException
>       #end
>     {
>       #if ($objectIsCaching)
>         #if (!$silentDbFetch)
>         if (isNew())
>         {
>             init${relCol}();
>         }
>         #else
>         if ($collName == null)
>         {
>             $collName = get${relCol}(new Criteria(10));
>         }
>         #end
>         return $collName;
>       #else
>         return get${relCol}(new Criteria(10));
>       #end
>     }
> </snip>
> 
> Which means: "If caching is enabled, return the chached collection 
> (whatever war the criteria utilized to generate it)"
> 
> IMHO this is uncorrect for the same considerations of the first post.
> 
> The only way to obtain the correct results is to disable the caching, 
> which leads to a _no_caching_at_all_ situation (bad vibrations, man)
> 
> 
> Or we still have not understood the objective of the method (most 
> likely) or the method behaviour is still the same of the 3.1.
> 
> Andrea Papotti
> Alchimie Digitali S.r.l.
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are 
confidential communication or may otherwise be privileged or confidential and 
are intended solely for the individual or entity to whom they are addressed.  
If you are not the intended recipient you may not rely on the contents of this 
email or any attachments, and we ask that you  please not read, copy or 
retransmit this communication, but reply to the sender and destroy the email, 
its contents, and all copies thereof immediately.  Any unauthorized 
dissemination, distribution or copying of this communication is strictly 
prohibited.



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

Reply via email to