I'm looking into using apex scheduler to run a batch job. We can run it whenever we want, say 3 am when traffic is low, but I'm trying to anticipate some 'Oh-Crap' Scenarios. Can you guys help answer these questions for me?
Setup:
When the user modifies a territory 100k's of records can get updated.
Questions:
What are some scenarios that can realistically cause my jobs to not terminate? I thought of a scenario of- when a user is editing a contact which happens to be in one of the batches is being run.
What are some good practices for dealing with jobs that don't terminate? I was thinking about scheduling another batch job 2 hours after this one, but I don't see my boss liking that. I thought about maybe doing something in the finish() method- but don't know what exactly.