Login | Register
My pages Projects Community openCollabNet

Reply to message

* = Required fields
* Subject
* Body
Send reply to
Author (directly in email)
Please type the letters in the image above.

Original message

Author Alan Pinstein <apinstein@mac.com>
Full name Alan Pinstein <apinstein@mac.com>
Date 2006-10-04 12:47:23 PDT
Message Ok, well I am glad I convinced you!

For now, if you need to emulate the soon-to-be PropelRS, you can just
doSelectRS() and manually hydrate. This is the current (and it should
be future-safe) way to iterate many many objects in a memory-
efficient way.

In the future, the proposed PropelRS will let you use the Iterator
interface to achieve lazy-hydration.


On Oct 4, 2006, at 3:26 PM, Sven Tietje wrote:

> Alan Pinstein schrieb:
>> Yeah, I don't get it either.
>> Right now, if you use XXXPeer::doSelect() you get an array with
>> all objects populated. If you plan on using *all* of the objects
>> in the result set, then it doesn't improve performance to hydrate
>> them on-demand; it just changes WHERE the cycles happen, but this
>> doesn't matter, because the overall performance won't change..
> yes, it just one iteration over the resultset, that you do later on
> - thats true! you are absolutely right. sometimes, you have to
> iterator twice or three times over one resultset (different places
> of output, logical iterator). creating them on the first iteration
> will save one foreach - don`t laugh!!! :-)
> somestimes, you iterator over a resultset and set values. later on
> in your application, you iterate again over the resultset and want
> to do something and to save your objects. a caching is need to make
> compatible to older versions:
> $rs = XXXXPeer::doSelect();
> $rs[0]->setName('test'); // object#1
> $rs[1] //object#2
> ... your application....
> $rs[0]->getName(); // object#1
> $rs[0]->setFirst​Name('test2'); should always work on the same
> object instance.
> but sometimes, you habe to iterate once - then caching should / can
> be disabled:
> $rs = XXXXPeer::doSelect(Criteria, Propel::NO_CACHING);
> $rs[0] // object #1
> later on again would result in:
> $rs[0] // object #2 ()
> i just want to have one resultset having the functions of the
> actual array propel gives to me, but also the possibilty to do the
> "real iterate way" to save memory. for the last variant my idea was
> to use FETCH_INTO, but alan convineced me: "the only overhead is
> __construct" (when you real can call it overhead :-))
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org