private function clearDocumentManagers()
    {
        if (!$this->container->hasParameter('doctrine_phpcr.odm.document_managers')) {
            return;
        }

        foreach ($this->container->getParameter('doctrine_phpcr.odm.document_managers') as $id) {
            if ($this->container instanceof IntrospectableContainerInterface && !$this->container->initialized($id)) {
                continue;
            }

            $this->container->get($id)->clear();
        }
    }