I have a batch process where it's intermittently failing due to what looks like the batch query timing out (details are here if you're interested).

The error ends up looking like this in my log.

enter image description here

I would like for me or the org's admin to receive an email notification if this occurs. Currently nothing's being sent by SF, I assume because this is a low-level unhandled exception in SF, and the batch is "Aborted" rather than "Failed".

Furthermore, since it's happening on the query, the execute method is never getting run, so I don't think I can do a try/catch in my batch to catch this error and report it.

How can I provide a notification on this sort of timeout?


  • 1
    I've been seeing this for over a year. I'm pretty sure it's a bug, since they try really hard not to show ORA errors but haven't had any luck getting support to admit it or file it with R&D. Apr 25, 2014 at 1:31
  • Do any of you think that these ORA errors happen for reasons other than query timeout? This article help.salesforce.com/… and my own experience point to this being a timeout in the back-end Oracle db. There's also this: dba-oracle.com/…
    – mscholtz
    Apr 26, 2014 at 15:58

1 Answer 1


Your best option right now would be to run a scheduled class that periodically check your batches (AsyncApexJob) for any jobs that meet that certain type of error message, and send a notification about the failures. You'll want to keep track of which notifications you've already sent out, since you can't simply "delete" the failed operations or affect their status in any way. Any time we see an error with a ORA code is an internal bug that somehow floated past the layers of code designed to catch those errors.

  • Makes sense, was thinking along the same lines.
    – mscholtz
    Apr 26, 2014 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .