function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

SQLException for cCronJobDetail.insert_detail



We have designed our application to process large amount of data using Batch Apex.

We are creating 5 parallel jobs for the batch created to perform the execution, the whole idea is to improve the performance of the app.

During execution, under Monitoring -> ApexJobs, we find the below exception:


First error: java.sql.SQLException: ORA-00001: unique constraint (CORE.AKCRON_JOB_DETAIL) violated
ORA-06512: at "HAPPY.CCRONJOBDETAIL", line 84
ORA-06512: at line 1
: {call cCronJobDetail.insert_detail(?,?,?,?,?,?,?,?,?)}


We are scheduling the jobs in the finish method of the Batch created. 

Is this error thrown because of the cron creation done across parallel jobs, where we see a race condition ?

Please let us know if there are any pointers where we could avoid the above error which we dont have a control on. Rather we could make the cron creation synchronous, if there is a way.

Thank You.



Jerun JoseJerun Jose
It looks like a low level exception on the SF servers. Suggest you to raise a ticket.

Yeah its a low level exception, but it could be handled from apex code.


When creating the apex jobs and scheduling then, we have to make sure that the "name" of the scheduled job should be unique. There are two ways to make sure the name is unique:


1) Put a static string for each job

2) Add getTime() to the name


Thank you.



Hi SumanGiriHanmandla!


Did you get any solution for this issue?

I am here with the same problem.






Please try with any of the below options and things should work as expected:

1) Put a unique static string for each job

2) Add getTime() to the name


The name which is the first parameter should be unique for executing the job.

I had both in place and things started working.







Thanks a lot.


It's working as expected now.

We were putting a unique name just to the scheduled job, not for the batch job.