So, if I put

$table->getAdapter()->beginTransaction();

before, and

$table->getAdapter()->commit();

after for loop, it should help? I'm not sure about this, but I can try.

Setting active is ok, this is enum, but you're right, I should go with one
update query, doing it on Zend_Db_Table_Row level is stupid, don't know why
I solved it this way at all.

Thanks.

Regards,
Saša Stamenković


On Wed, May 19, 2010 at 11:48 AM, Jurian Sluiman <subscr...@juriansluiman.nl
> wrote:

> You executes many queries in a for loop, absolutely not recommended. Use
> transactions or even better, loop through all models and create one query:
> UPDATE my_table SET status='ACTIVE' where id IN (1,2,3,4,5,6,7,8). Both are
> possible with ZF.
>
> Regards, Jurian
>
> PS. Why activate a record by setting a value to string "ACTIVE"? You should
> look at some performance guide and use a kind of boolean field to set the
> state.
> --
> Jurian Sluiman
> CTO Soflomo V.O.F.
> http://soflomo.com
>
> On Wednesday 19 May 2010 11:42:57 umpirsky wrote:
> > Anyone who knows how this works in the backround?
> >
> > It really kills the server. This error spam the error log, and site goes
> > down, but I still can to connect to db from mysql client (other IP).
>

Reply via email to