Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clear propel cache (instance pool)

Tags:

symfony

propel

I need to force reread data from DB within one php execution, using propel. I already have a bit hacky solution: call init%modelName% for corresponding classes, but want something better.

Is there any single call or service config option for that? Like killing whole instance pool.

About service: we use symfony2 and don't need cache only in one specific case, hence we can create even separate environment for that.

like image 213
kirilloid Avatar asked Dec 16 '22 21:12

kirilloid


1 Answers

You can globally disable the instance pooling by calling: Propel::disableInstancePooling() (Propel::enableInstancePooling() is useful to enable the instance pooling).

Otherwise, you can rely on PEER classes which contain generated methods like clearInstancePool(), and clearRelatedInstancePool().

like image 152
William Durand Avatar answered Jan 04 '23 04:01

William Durand