Clearing the cakephp tmp/cache solves the issue for only one save call. What can be the reason?

hack3r picture hack3r · Aug 3, 2013 · Viewed 14.5k times · Source

I modified the schema of mysql database(added a new table etc.), I cleared the tmp/cache(except directories). Now the save in the new table happens only once(I have multiple save calls in a for loop and save happens for all of them) and fails from next time I enter the flow.

I am using cakephp 1.3.

What else should I check ?

Answer

hack3r picture hack3r · Aug 7, 2013

Got it.

The cache issue was one part of the problem, which got fixed by clearing the files in tmp/cache directory.

Learning is - If you make mysql schema changes(add new table / column etc.) in mysql, either clear the tmp/cache directory or set the debug level as 3 and refresh the page and set the debug level again to 0(if on production).

I was also getting a save error - mysql server has gone away, because in configs the wait_timeout value was 600 seconds. But my script was taking longer than that. So model->save() was not working.

In my.cnf I updated the timeout to 4800 and restarted mysql and it fixed the problem.