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
sornasorna 

A strange Exception with Apex scheduler

Hi,

I am using apex scheduler functionality. In that apex class which implements the schedulble interface, I have written system.abortjob(sc.gettriggerId()) function to abort the scheduled job, based on some condition. While doing so, I am getting the following error:

 

java.sql.SQLException: ORA-20001: ORA-06512: at "DOPEY.CMETAACCESS", line 510 ORA-01403: no data found ORA-06512: at "DOPEY.CMETAACCESS", line 667 ORA-06512: at "DOPEY.CMETAACCESS", line 656 ORA-06512: at "DOPEY.CMETAACCESS", line 626 ORA-06512: at "DOPEY.CMETAACCESS", line 609 ORA-06512: at "DOPEY.UDDDMLCRONTRIGGER", line 68 ORA-06512: at line 1 : {call UddDmlCronTrigger.get_detail(?,?,?)}

 

I dont know what this error about. But it showing the line number where the abortJob function is written. 

Please give your suggestion on this.

thanks in advance,

mtbclimbermtbclimber

Please log a case with support so we can investigate.

 

Thanks,

MJ09MJ09

Was there a resolution to this issue?

 

I'm getting a similar error while calling System.abortJob() to remove a Scheduled Apex job.

The schedulable class does this:

    global void execute(SchedulableContext SC) {
        Custom_Settings__c cs = Custom_Settings__c.getOrgDefaults();
        if (cs == null) cs = new Custom_Settings__c();
        cs.Scheduled_Job_ID__c = SC.getTriggerId();
        upsert cs;
    }

The code that tries to unschedule the Apex class does this:

    Custom_Settings__c cs = Custom_Settings__c.getOrgDefaults();
    if (cs.Scheduled_Job_ID__c != null) {
        System.abortJob(cs.Scheduled_Job_ID__c);
    }

The exception I'm getting is this:

System.StringException: java.sql.SQLException: ORA-20001:
ORA-06512: at "HAPPY.CMETAACCESS", line 510
ORA-01403: no data found
ORA-06512: at "HAPPY.CMETAACCESS", line 667
ORA-06512: at "HAPPY.CMETAACCESS", line 656
ORA-06512: at "HAPPY.CMETAACCESS", line 626
ORA-06512: at "HAPPY.CMETAACCESS", line 609
ORA-06512: at "HAPPY.UDDDMLCRONTRIGGER", line 68
ORA-06512: at line 1
: {call UddDmlCronTrigger.get_detail(?,?,?)}

First Dopey, then Happy. I sense a Snow White & the Seven Dwarfs theme...

 

(I just created a Case for this problem, but thought I'd post here too in hopes of getting a quicker answer.)

 

MJ09MJ09

Just to follow up, in case somebody else runs into this same problem.

 

This oddly-worded error message seems to be what you get if you call System.abortJob() with the ID of a job that doesn't exist. The error message varies -- sometimes it's DOPEY, sometimes HAPPY or one of the other 7 Dwarfs.   Oddly-worded though it is, the message is (at least in my case) complaining about a legitimate problem: I was passing in a bad Job ID, and when I passed in a good ID, abortJob() worked just fine.

 

Hint: the Apex Developer's Guide currently says that you should call System.abortJob() with a "job name." Don't. Instead, call it with the job ID. You can get the job ID as the return value from System.schedule() or from the SchedulableContext that's passed into the job's execute() method. If you don't capture the job ID in one of those two ways, you're out of luck -- there's no other way to determine the ID of an already-scheduled job.

 

Another hint: I was trying to stash the job ID in a Custom Setting. (I had seen this done in another discussion board posting at http://community.salesforce.com/t5/Apex-Code-Development/Need-a-way-to-programatically-change-or-delete-a-Scheduled-Job/m-p/178933). Don't do that -- from what the Salesforce Support rep told me, Custom Settings are write-once, so if you ever try to reschedule your job, you won't be able to change the value of the Custom Setting.

Novo_ArtisNovo_Artis

Sorry to revive this topic (add an off topic part aswell) but I had to address this


MJ09 wrote:

from what the Salesforce Support rep told me, Custom Settings are write-once, so if you ever try to reschedule your job, you won't be able to change the value of the Custom Setting.


I just had to say that in my production instance I was successfully able to update via custom settings fields via apex code without problem.

 

spbalajeespbalajee

There is a way to determine the ID of an already-scheduled job (Even if you didn't capture it during schedule or execute). Goto Monitoring -> Scheduled Jobs. Locate the job. Copy the URL of the Del hyperlink. The value for the query parameter delID is the Job Id!! 

 

This value can be used with system.abortJob to stop the job.

 

Hope this info is useful.

 

Balaji.

 

 

Angelo Rivera 1029Angelo Rivera 1029
Hi, 
Can this be applied to an error below, which occurs on a validation error?

09:34:35.713 (1757340328)|VALIDATION_ERROR|Validation Formula "Prevent_Case_Closure_When_Owner_is_Queue" Invalid (system.security.NoDataFoundException: ORA-20001: 
ORA-06512: at "DOPEY.CMETAACCESS", line 553
ORA-01403: no data found
ORA-06512: at "DOPEY.CMETAACCESS", line 732
ORA-06512: at "DOPEY.CMETAACCESS", line 718
ORA-06512: at "DOPEY.CMETAACCESS", line 683
ORA-06512: at "DOPEY.CGROUP", line 1217
ORA-06512: at line 1


{call cGroup.get_group(?,?)}

{call cGroup.get_group(?,?)})
Alex Savarda 9Alex Savarda 9
I ran into a similar error regarding a Validation Rule. I was updating a custom object from another custom object in a trigger handler. It was in a dev environment (partial sandbox) so there were references to missing data in certain objects. Once I changed the data I was working with the error disappeared.