protected function doPersistList(ResourceListInterface $resources, $autoCommit, $type)
    {
        $hasError = false;
        $hasFlushError = false;

        foreach ($resources as $i => $resource) {
            if (!$autoCommit && $hasError) {
                $resource->setStatus(ResourceStatutes::CANCELED);
            } elseif ($autoCommit && $hasFlushError && $hasError) {
                DomainUtil::addResourceError($resource, $this->translator->trans('domain.database_previous_error', [], 'FxpResource'));
            } else {
                list($successStatus, $hasFlushError) = $this->doPersistResource($resource, $autoCommit, $type);
                $hasError = $this->finalizeResourceStatus($resource, $successStatus, $hasError);
            }
        }

        return $hasError;
    }