2009年9月10日星期四

Re: [fw-db] A method to disable a row auto-refresh

Xavier,

Without refresh, any database assigned information would not be retained
by the row object. In mysql: timestamp, CURRENT(), any primary keys
that are not auto-increment would be lost. Also, if the row is subject
to any triggers, information from the trigger would be lost.

So ulimately, you probably wouldnt want to set a flag like that
statically as you really would want to opt into that kind of feature on
a row-by-row object basis.

If you want to work up a patch and submit it to the issue tracker, we
can explore the possibility.

Keep in mind, as you move away from straight queries, to a table
gateway, then to a row gateway, and closer to a real ORM, you are
effectively buying into a more maintainable object-database solution;
and alot of times at the cost of performance.

-ralph

Xavier Vidal Piera wrote:
> Hi
>
> I've seen every time i save a Zend_Db_Table_Row, an extra SELECT is
> executed to reload the row's data.
>
> In terms of performance, i suggest to lazy load the row from db only if
> we want to access again to any of the row attributes. It's useless to
> have an extra SELECT if we don't want to access again to the row.
>
> Is there any stopper to implement this feature?
>
> Something like Zend_Db_Table_Row::setAutoRefresh(true|false);
>
> Thanks
>
> --
> Xavier Vidal Piera
> Director Tècnic de Citrusparadis.com - Grupo Intercom
> Enginyer Tècnic Informàtic de Gestió
> Tècnic Especialista Informàtic d'equips
> xavividal@gmail.com <mailto:xavividal@gmail.com>
> 610.68.41.78

没有评论: