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
kurtz_wolfgangkurtz_wolfgang 

Java SQL exception

Hello All,

 

  I have a batch class which simply updates a boolean value on all the opportunityLineItems to true and updates them. This in turn fires a trigger which recalculates the forecasts and schedules for those OpportunityLineItems. 

 

  I have kept a batch size of 1000 records. However when I execute the program..I see the following exception entered in ExtendedStatus field of the AsyncApexJob for Jobtype=BatchApexWorker ...

 

First error: java.sql.SQLException: ORA-20423: 
ORA-06512: at "GRUMPY.SOPPORTUNITY", line 4691
ORA-06512: at "GRUMPY.SOPPORTUNITY", line 4840
ORA-06512: at line 1
 
SQLException while executing plsql statement: {call sOpportunity.validate_rollups(?,?...
 
Moreover, if when the program began and the total batch items were 500, after this exception entry the total number of batches decreases to 451. Also there is no entry of above exception in the debug log and status of the batch program is successful. This is very urgent and any light on this matter would be very helpful.
 
Regards,
K
Best Answer chosen by Admin (Salesforce Developers) 
kurtz_wolfgangkurtz_wolfgang

So we found that the TotalPrice on a Opportunity Product doesn't not match the revenue of the Schedules of that Opportunity Product. 

 

The probable cause of this error : We were refreshing our sandbox from our production and these opportunities were updated in production during the refresh. I believe that was the reason for this discrepancy. 

 

The only way to resolve this issue is to delete those Opportunity products and re create them. It also prevents you from updating those opportunities.

 

Thanks everybody for taking a look at this.

 

KB.

All Answers

_Prasu__Prasu_

Is it firing any email alert workflow after or sending mail from trigger with merge fields? If yes, then this is the reason behind that exception. As rollups is being recalculated and being used in email template before calculation is complete may be.

kurtz_wolfgangkurtz_wolfgang

Sorry for the late response, but it's Salesforce bug and has been submitted. We have been waiting for more than a month for resolution.

 

Thanks,

K

kurtz_wolfgangkurtz_wolfgang

So we found that the TotalPrice on a Opportunity Product doesn't not match the revenue of the Schedules of that Opportunity Product. 

 

The probable cause of this error : We were refreshing our sandbox from our production and these opportunities were updated in production during the refresh. I believe that was the reason for this discrepancy. 

 

The only way to resolve this issue is to delete those Opportunity products and re create them. It also prevents you from updating those opportunities.

 

Thanks everybody for taking a look at this.

 

KB.

This was selected as the best answer