Firstly, great libraries - I’m just getting started and really enjoying them!
I’m having an issue with a fairly large table I am using as the source to the events in my Scheduler. It has about 80K rows and whenever I try to load the data for the Scheduler I get the following error returned:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /var/www/web/cake/libs/model/datasources/dbo/dbo_mysql.php on line 762
I’ve tried using dynamic loading with scheduler.setLoadMode(“day”) and still am getting the same error. If I truncate the table to only a few hundred rows, the Scheduler loads correctly and the dynamic loading works as expected.
As you can see from the error above, I am using the Scheduler in conjunction with CakePHP. I can access the large table from other parts of my web app without a problem, but it seems as if somewhere the entire dataset is being loaded rather than the range specified by the dynamic loader.
Any pointers as to where I’m going wrong? Thank you!
I think I may have traced down the issue. I am using beforeRender to translate the columns in the table from start+duration to start+end datetimes. Now that I think about it, the app would have to run each row through that to determine the range in view. Is dynamic loading not an option if I am translating the fields like that? Thanks!
Is dynamic loading not an option if I am translating the fields like that?
Built in solution will not work, it requires ready to use fields, like start_date and end_date for dyn. loading
I think the best strategy will be
a) drop connectors on server side
b) use custom action handler in which poll your model, you can use $_GET[“from”] and $_GET[“to”] parameters, which will contain required span of dates for the dyn. loading mode.
c) after having necessary data ( as array of hashes ) - you can use json_encode on it and output result
d) on client side use scheduler.load(url, “json”);
Also, if you still want to use connector - I think it possible to use render_sql and some arcane sql select which will calculate start and end dates directly in sql. ( to use render_sql you need to init connector against DB, not against cakePHP model as described in tutorial )
Thank you for your suggestion. I will give it a try. Worst case, I’m thinking it may be easier to change the data in the database to start and end datetimes and just make a few changes elsewhere in my app. Thanks again.