You need to sign in to do that
Don't have an account?
nathan.edwards
Queueable invalid interface name
I've been trying to get the new Queueable Interface to work using API version 32. Developer console keeps giving me "Invalid Interface name provided". Anyone experimented with this and get it to work?
All Answers
But I have found that -- compiles.
You are right, It is true that in my dev org I have to save the class with the anotation :
did you try to run it?
It gives me an error: Internal Salesforce Error: Method is not implemented.
Therefore seems like it is a little bit "bug-y / flaky " at the moment :-) .
However , said that, I went to my sandbox where I used already Queueable interface, Queaueble works ok there.
To the question if it is possible to do callouts from a Queable the answer is yes, at least I'm able to. Here it is a sample code:
I'm also able to chain a job after the callout :
However what I can't do (yet :) ) is to try to do a DML before I do a callout within the same "execute" like this:
It tells me : You have uncommitted work pending. Please commit or rollback before calling out
Hope it helps.
Thanks,
Carolina.
You are correct about DMLs and callouts, once your thread of execution has done any DML, callouts are strictly verboten. SF designed it that way has they will be holding a connection open to the underlying database (Oracle I believe) as soon as the first DML is issued and they don't want to hold that connection while up to 120 seconds of callouts are going on. That has always been the case, even in non-batch Apex. In fact, the reason I'm using batch apex is because I need to do some DMLs, then do a callouts, then do some more DMLs. So the first set of DMLs is in regular Apex and then I submit a queueable that does the callout and then the remaining DMLs.
Yeap, You are right, that is the case, ( for this reason I said "yet" as a joke :) ) , and as you pointed out we can always do a chaining in order to do the DMLs.
Great! Thanks!!
Carolina.