Use batch interfaces, and set num_retries on each execute call.