OK, yes it's cache. I used Modell::query() in myAction() and that was the cause of the "problem". Here is the warning I finally found in Cookbook:
"query() does not honour $Model->cachequeries as its functionality is inherently disjoint from that of the calling model. To avoid caching calls to query, supply a second argument of false, ie: query($query, $cachequeries = false)" So the problem was not with requestAction(). On Mar 26, 5:24 pm, brian <[email protected]> wrote: > cache, maybe? > > You're right, though: it's very likely that you'd be better off doing > $this->Model1->Model2->myAction() > > On Thu, Mar 26, 2009 at 3:31 PM, zonium <[email protected]> wrote: > > > I call requestAction('another_controller/myAction') at different > > places from a controller. What myAction() does is run a SQL query to > > get some data from DB. > > I notice that the SQL query in myAction() gets executed only the first > > time the requestAction('another_controller/myAction') is called. For > > any subsequent calls, the SQL query does not get executed, and same > > query result from the first call to requestAction() is returned. > > > Why is that? > > > (I know that myAction()'d better be placed in model. However I am > > trying to find out why the problem happened to requestAction as I > > described.) > > > Thanks for any insight. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
