• Robert Smith 151
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 9
    Replies

 
Hi all,

We need to implement the following pattern at my org:
  • callout to external data source
  • if that callout takes too long (according to some configurable threshold), log an error (ie do some DML)
  • if that callout timed out on the remote server, try it again
Recognizing the potential for the dreaded "You have uncommitted work pending. Please commit or rollback before calling out." error, I put the error logging code in a future method, thus isolating the DML from the callouts. However, the error is still being thrown. I reduced the issue down to this pattern:
public static void foo() {
    Http http = new Http();
    HttpRequest req = new Httprequest();
    req.setEndpoint('https://test.salesforce.com'); //whatever endpoint
    req.setMethod('GET');
    http.send(req); //works fine
    bar();
    http.send(req); //throws calloutexception
}

@future public static void bar() {

}
Am I correct to assume that calling a future method counts as a DML operation? Is there any documentation I'm missing somewhere?

 
Now it’s simple to Recover OST to PST Emails in MS Outlook 2016 with this smart working OST to PST Converter software that’s fabulously Recover OST emails from corrupt Outlook Offline Storage Table and provides new file format to save OST into PST with all Outlook OST 2016 folders like Journal ,Task ,Calendar ,Notes ,Contacts ,Sent items ,draft ,Outbox ,Appointments ,etc .

 
Know how this OST to PST Email Converter tool successfully repair & restore OST to PST .

It simply create a platform to Recover OST file emails into MS Outlook and save all recovered OST email data into PST file by making repair of each .OST email into .PST .This Enstella OST to PST Converter tool support all old and latest version of Microsoft Outlook (OST and PST both ) 97,2000,2002,2003,2007,2010,2013,2016.

 
For more get download of OST to PST Software free demo from this link :-    Recover OST to PST


recoverosttopst