Skip to content

A nightly background job for creating and delivering shipments mostly succeeds, but a few of the jobs intermittently fail with ORA-00060 ('deadlock detected while waiting for resource') — what can be done to prevent this?

Answer

Check the batch queue's Processes setting for the queue that job runs in — if it's set higher than 1, multiple posted background jobs in that queue can execute in parallel, which is a common cause of this kind of deadlock; reducing Processes to 1 forces the jobs to run sequentially instead, eliminating that source of contention. It's also worth checking whether a job in a completely different batch queue could be running at the same time and touching the same records — if so, consolidating both jobs into the same queue (with Processes set to 1) sequences them relative to each other too. For a more precise root cause, the Oracle trace files generated when a deadlock is detected and resolved identify exactly which other session was involved, which is the most reliable way to pin down what's actually colliding.

← Browse Developer Studio, deployment, and upgrades questions