You need to sign in to do that
Don't have an account?
GlynA
How big can a Schedulable class instance be?
Hey Community! I've got a class that implements Schedulable. It has members that are lists of sObjects. Sometimes these lists can be very large (thousands of records). When I try to schedule these large instances, it fails, saying that the scheduled object is "too large". I can't find anything that describes how large a Schedulable class instance can be. Does anyone out there know?
Thanks in advance,
Glyn Anderson
Sr Developer / Systems Analyst | ClosedWon | closedwon.com
Certified Developer | Certified Advanced Administrator
Thanks in advance,
Glyn Anderson
Sr Developer / Systems Analyst | ClosedWon | closedwon.com
Certified Developer | Certified Advanced Administrator
Thanks for answering. Here's the problem: The records I have are the records I want to put into the database - I can't query them when the Schedulable class runs. I've got code that queries a set of records from the database and, based on those records, creates and updates a large number of other records - potentially too many to do DML in a single transaction. My idea was to create a Schedulable class to spread the DML out over several transactions. The class has all the records to be DML'ed. When it runs it does as many records as it can (using Limits methods) and schedules itself again to do the remainder. When it's done, it schedules a "continuation job". This has worked with over 9,000 records, but failed with some larger number. I'm not sure at what point the instance gets too big.
I have also considered breaking the DML into transaction-sized chunks and creating a batchable job for each chunk. The Batchable class would take a list of sObjects in its constructor and the start method would return that list as the iterable for the batch. I could then execute these Batchable instances with a scope size of 10,000 (or a value from Limits) and the execute method can do the DML. This still has the potential for the Batchable instance to be "too big".
Another problem is that even if I knew how big a Schedulable/Batchable instance could be, is this the size in memory or the size as serialized for persistence in the database? And then, how can I know how big my collection of sObjects is (in bytes or whatever, as opposed to # of records)? Basically, how can I gaurantee that my Schedulable/Batchable instance is not too large?
Any thoughts would be very much appreciated!
-Glyn
Hi GlynA,
I do have an issue with below code, can you please help me. The issue is i am not able to save the updated values to the save record id. And all the values of the same account are being displayed. Can you please help.
I do have values as below
When i click on the Sort by, the top 5 Account Priorities should display in a separate page and should be editable. Once i do change the priority i should be able to Save. The values should change return to the previous page. Please find my code as below
Visual Force Page
Apex Class Page
Can anyone please suggest.