Thanks Zsombor, This is what I'm looking for.  The LargeSelect class that
keeps getting brought up as a "solution" is just a workaround that isn't
acceptable for the long term.

So the reason that Torque was designed with Lists in the first place is
because of the same limitation in the underlying village infrastructure.
I'm not familiar with what village is and who owns it (I only found
information about dogs on the village.workingdogs.com website!).  Aren't
village and torque the same project now?  Wouldn't it be easiest to add the
functionality to village first to avoid the weaknesses you mentioned?

Are you interested in implementing this or were you just thinking out aloud?
I hate to be one of those people who hounds other people to do the work, but
I have a rather full plate of my own to work on.  This is a critical issue
for me.

Martin Jericho

----- Original Message -----
From: "Zsombor Gegesy" <[EMAIL PROTECTED]>
To: "Torque Dev" <[EMAIL PROTECTED]>
Sent: Tuesday, July 30, 2002 7:55 AM
Subject: Iterating through a large list


> Hi,
>
>  I think the preferred solution could be, something like:
>
> Generate a XXXIterator.java,  which encapsulates the ResultSet, and
> one-by-one creates the persistent objects.
>
> public XXXIterator extends BaseIterator {
>  ...
>    public XXX nextXXX();
>
>    // for java.util.Iterator
>    public Object next();
>   public boolean hasNext();
>
> // to close the ResultSet, release the Connection
> // probably 'hasNext()' should call this, in the end of the ResultSet
> public void close();
>
> }
>
> and create a method in BaseXXXPeer.java :
>
> public XXXIterator doSelectToIterator(Criteria criteria);
>
> As i look through the code, this could be an easy solution, however i
> found two possible 'weaknes' :
> 1, we must make some ugly hack, to use com.workingdogs.village.Record,
>  because all of it's constructor need a village.DataSet, or we must
>  make the necessary conversion from ResultSet -> BaseXXX by hand.
>  Or we could make a row2Object/populateObject which accept not a
>  village.Record, but an array of village.Value-s (I think, this is the
>  nicest version)
> 2, warn the developer to not to forget to close the XXXIterator, with
>  the explicit close() method call, or just iterateing through the
>  resultset
>
> Bye
>  Zsombor Gegesy
>
>
> --
> 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