AutoSys Events Fail with CAUAJM_E_40225 and ORA-04021: timeout occurred while waiting to lock object
search cancel

AutoSys Events Fail with CAUAJM_E_40225 and ORA-04021: timeout occurred while waiting to lock object

book

Article ID: 437708

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

The AutoSys Scheduler log shows multiple failed events accompanied by database lock errors. Symptoms include:

  • EVENT_HDLR_ERROR alarms in the event demon log.
    [04/20/2026 22:01:08] CAUAJM_E_18416 Event Server: Failed Query: <BEGIN :RetVal := ujo_post_event ...>
    [04/20/2026 22:01:08] CAUAJM_E_18402 ORA-04021: timeout occurred while waiting to lock object
    [04/20/2026 22:01:08] ORA-06512: at "AEDBADMIN.UJO_POST_EVENT", line 675
    [04/20/2026 22:01:08] CAUAJM_E_40225 Trouble processing Event [XXXXXXX]!
  • CAUAJM_E_40225 Trouble processing Event [EVENT_ID]!
  • CAUAJM_E_18402 ORA-04021: timeout occurred while waiting to lock object
  • CAUAJM_E_10619 Return values from dual database writes disagree (in Dual DB configurations).
  • Impacted jobs may miss their next start time or stay in their previous status despite completing on the agent.

Cause

The ORA-04021 error indicates that the AutoSys Scheduler (via the ujo_post_event stored procedure) attempted to lock a library object in the Oracle database but timed out because another process held a conflicting lock.

Common triggers include:

  • Oracle Maintenance Tasks: Automated tasks such as SQL Auto Tune or GATHER_STATS running during high workload periods.
  • Schema Changes: Compiling packages or modifying tables while the application is actively using them.
  • Resource Contention: Heavy database load causing delays in releasing library cache pins/locks.

Resolution

  1. Identify the Blocker: Coordinate with your Database Administrator (DBA) to check the Oracle v$session_wait and v$librarycache_lock views to identify the session holding the lock during the error window. 

  2. Verify Event Processing: Check the ujo_event table to see if the specific events cited in the logs were eventually processed or if they remain in an error state.

    sql
     
    SELECT * FROM ujo_event WHERE eoid = '[EVENT_ID]';
  3. Remediate Missing Schedules: If a job missed its next start time due to the failure:

    • Run a manual send_event -E JOB_ON_ICE followed by JOB_OFF_ICE or perform an update_job via JIL to force the Scheduler to recalculate the next start time.
  4. Preventive Measures:

    • If the cause was an Oracle Auto Tune task, consider rescheduling such tasks to a window with lower AutoSys event volume.
    • Ensure Oracle statistics are up to date to prevent suboptimal execution plans that might increase lock hold times. Slow AutoSys event processing...