You need to sign in to do that
Don't have an account?
AgentDealerX
Batch Chaining Error
I'm having an issue with Batch Apex. I have a batch class AutoAssignBatch and a scheduler class AutoAssignScheduler. In the finish() method of the batch, under certain conditions, I schedule an AutoAssignScheduler job, which then executes another batch job. The batch runs fine on the first run, but when it comes back around, it runs for a couple hours before giving me the error "All attempts to execute message failed, message was put on dead message queue."
Does anyone know what could be causing this?
Thanks everyone for your quick responses! Whatever the error was, I'm not having it anymore. I'm not sure what caused it or fixed it, but it's gone.
All Answers
You cannot call the Database.executeBatch method from within any batch Apex method. Check out this : http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm
A very good link to serialize the batch class :
http://devendranatani.blogspot.com/2011/03/serialize-batch-apex-in-salesforce.html
If you're after Batch Chaining, then the System.schedule in the finish of one batch can be used to schedule another batch job. However, keep in mind the limit on the max num of jobs which can be scheduled at a given time (reckon its 10)
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_system.htm#system_schedule_method
Thanks everyone for your quick responses! Whatever the error was, I'm not having it anymore. I'm not sure what caused it or fixed it, but it's gone.
I don see any solution for this subject :\
Actually, i am now facing this error too.... any1 can give me some idea to solve this....
Best
kitty!