Find your content:

Search form

You are here

MIXED_DML_OPERATION, Not Allowed: Original Object CronJobDetail

 
Share

I'm trying to get around the MIXED_DML_OPERATION. I touch some custom sObjects, custom settings, and than schedule a CronJob via System.schedule

The API Version of these classes is v19, and it's my understanding that Custom Settings are no longer included in the non-allowed 'setup objects' after V18.

Basically the same problem as described here.

This only seems to be happening after the package has been installed into a new org (Winter '13 Sandbox). Does anyone have a list of which objects are considered "Setup Objects"? Are custom settings still considered setup objects?

Update

Can't confirm that my sandbox (CS4) is where I'm able to recreate so I'm assuming it's on Winter 13 but not positive. Either way, not able to recreate in a Partner Dev org.


Attribution to: jordan.baucke

Possible Suggestion/Solution #1

It's a bug with System.Schedule and System.abortJob; salesforce reference number is W-1400761. The fix is tentatively scheduled for sometime Thursday (10/4/2012).

Latest comments from SF partner premier support (who actually are helpful on this stuff!) is:

"I had requested for the information from Tier 3 and they have informed that there were some modification made and it was a regression issue. We will be reverting back to the previous process and so you do not require to do any changes to your code. Currently the proposed date for the patch release is Thursday 4th Oct."

As commented above, this issue affects the 180.6 (aka the 6th patch to Winter13) build of salesforce, which is what is currently running on all Winter13 sandbox orgs, I'm not sure if NA1 is on it or not yet.

Edit: Confirmed fixed as of today (10/4).


Attribution to: ca_peterson

Possible Suggestion/Solution #2

Here's a list >> sObjects That Cannot Be Used Together in DML Operations

From what I can read in this list, custom settings should not be considered setup objects in version 17 and later.

Some sObjects require that you perform DML operations on only one type per transaction. For example, you cannot insert an account, then insert a user or a group member in a single transaction.
The following sObjects cannot be used together in a transaction:
- FieldPermissions
- Group
- [...]
- Custom settings in Apex code that is saved using Salesforce.com API version 17.0 and earlier.

Can you verify that not some part of your code is running v16 or earlier, which, I believe, would "downgrade" the entire transaction to that version.


Attribution to: JLiljegren__c
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1865

My Block Status

My Block Content