I want to perform 5 callouts and log any callout exceptions as a new case. Since mixing callouts and DMLs is not allowed, I made the logging asynchronous. Unfortunately, an ExecutionException ("uncommitted work pending") is still being thrown when the new case is inserted into the DB by the @future method. Here's the callout class (simplified):
class CalloutClass {
// ...
public CustomResponse doCallout() {
try {
// ... callout logic
} catch (CalloutException coe) {
LogUtil.logException(coe.getTypeName()); // @future method
}
}
}
Are there any workarounds for this problem?