Salesforce Decode
Salesforcedecode
Back to questions
ApexAdvancedbulkificationdata-loaddml

Recover from a failed Data Loader job that partially committed 800k records

Real World Scenario

Nightly Account import via Data Loader inserted 800k rows before failing on row 812,000 with DML errors. Finance reports duplicate external IDs and orphaned child records.

Expected Answer

• Query AsyncApexJob and Bulk API job logs to identify failure point and error codes • Use external Id and staging object to identify committed vs failed batches • Batch delete or merge duplicates keyed on External_Id__c with dry-run report first • Re-run import with insert-only vs upsert strategy based on partial state • Trigger bypass flag for integration user during remediation only • Document rollback playbook: child records first respecting master-detail order • Post-mortem: validate batch size, trigger CPU, and selective indexes before retry

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Query AsyncApexJob and Bulk API job logs to identify failure point and error codes. Use external Id and staging object to identify committed vs failed batches. Pick based on your integration pattern and team capability. Partial bulk loads are data incidents—design staging tables and idempotent keys before first production load. Optimize for scale and operational observability.

Architect Perspective

Partial bulk loads are data incidents—design staging tables and idempotent keys before first production load.