Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 203
hack3r Avatar asked Aug 03 '13 04:08

hack3r


1 Answers

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.

like image 161
hack3r Avatar answered Oct 21 '22 23:10

hack3r