Let me provide a comprehensive solution to resolve your deadlock issues:
1. Deadlock Analysis in DB Logs - Root Cause:
Your ORA-00060 error shows a classic circular wait condition. Based on the ROWID reference, multiple Data Loader threads are competing for the same PROJECT_MASTER rows while holding locks on related PROJECT_SCHEDULE rows. This happens because Agile’s Data Loader uses parallel threading by default, and project imports have parent-child relationships that create lock contention.
2. Batch Size Adjustment - Optimal Configuration:
Modify your Data Loader configuration:
loader.batch.size=10
loader.commit.frequency=5
loader.thread.pool.size=2
Key changes:
- Reduce batch size to 10 (not 15) for projects specifically
- Commit every 5 records to release locks faster
- CRITICAL: Reduce thread pool from default 4 to 2 threads maximum
The thread pool reduction is essential - with 4+ threads, you’re guaranteeing lock contention on shared parent projects.
3. Transaction Isolation Tuning - The Game Changer:
For your import session, use SERIALIZABLE isolation:
ALTER SESSION SET ISOLATION_LEVEL=SERIALIZABLE;
-- Run your Data Loader import
ALTER SESSION SET ISOLATION_LEVEL=READ_COMMITTED;
While SERIALIZABLE is slower (expect 30-40% longer import time), it completely eliminates deadlocks by forcing sequential execution of conflicting transactions.
4. Phased Import Strategy:
Restructure your import process:
Phase 1 - Project Headers Only:
- Import PROJECT_MASTER records with basic metadata
- No schedule or resource data
- Use batch size 20 (safe without dependencies)
Phase 2 - Project Schedules:
- Import PROJECT_SCHEDULE with references to Phase 1 projects
- Batch size 10
- Single thread only (thread.pool.size=1)
Phase 3 - Resource Assignments:
- Import project resources and allocations
- Can use parallel threads again (dependencies resolved)
5. Database-Level Optimizations:
Add these indexes if missing:
CREATE INDEX IDX_PROJ_PARENT
ON PROJECT_SCHEDULE(PARENT_PROJECT_ID);
CREATE INDEX IDX_PROJ_STATUS
ON PROJECT_MASTER(STATUS, MODIFIED_DATE);
These indexes reduce lock hold times by speeding up foreign key lookups.
6. Monitoring and Validation:
During import, monitor deadlocks:
SELECT blocking_session, wait_time, seconds_in_wait
FROM v$session
WHERE blocking_session IS NOT NULL;
If you still see blocking after these changes, the issue is likely at the application server level (connection pool exhaustion).
Expected Results:
With these changes, your 120-project import should complete in approximately 45-60 minutes (vs. the 20-30 minutes you might expect with aggressive settings) but will complete successfully without deadlocks. The phased approach adds overhead but ensures data integrity and eliminates import failures that force you to restart from scratch.