Savepoint sp = Database.setSavepoint();
insert new Campaign(Name='test');
Database.rollback(sp);
HttpRequest req = new HttpRequest();
req.setEndpoint('http://google.com');
req.setMethod('GET');
Http http = new Http();
HttpResponse res =
http.send(req);
system.debug(req);
If you paste the above code into an anonymous block and execute, you will get the following error message:
System.CalloutException: You ahve uncommitted work pending. Please commit or rollback before calling out
However, as you can see, I am rolling back on the third line there. Am I missing something?