Symfony Exception

FeatureNotImplemented

HTTP 500 Internal Server Error

Second level cache does not support scalar results.

Exception

Doctrine\ORM\Cache\Exception\ FeatureNotImplemented

  1. class FeatureNotImplemented extends CacheException
  2. {
  3.     public static function scalarResults(): self
  4.     {
  5.         return new self('Second level cache does not support scalar results.');
  6.     }
  7.     public static function multipleRootEntities(): self
  8.     {
  9.         return new self('Second level cache does not support multiple root entities.');
  1.      * {@inheritDoc}
  2.      */
  3.     public function put(QueryCacheKey $keyResultSetMapping $rsm$result, array $hints = [])
  4.     {
  5.         if ($rsm->scalarMappings) {
  6.             throw FeatureNotImplemented::scalarResults();
  7.         }
  8.         if (count($rsm->entityMappings) > 1) {
  9.             throw FeatureNotImplemented::multipleRootEntities();
  10.         }
  1.             return $result;
  2.         }
  3.         $result $this->executeIgnoreQueryCache($parameters$hydrationMode);
  4.         $cached $queryCache->put($queryKey$rsm$result$this->_hints);
  5.         if ($this->cacheLogger) {
  6.             $this->cacheLogger->queryCacheMiss($queryCache->getRegion()->getName(), $queryKey);
  7.             if ($cached) {
  1.      * @return mixed
  2.      */
  3.     public function execute($parameters null$hydrationMode null)
  4.     {
  5.         if ($this->cacheable && $this->isCacheEnabled()) {
  6.             return $this->executeUsingQueryCache($parameters$hydrationMode);
  7.         }
  8.         return $this->executeIgnoreQueryCache($parameters$hydrationMode);
  9.     }
  1.      *
  2.      * @return mixed[]
  3.      */
  4.     public function getArrayResult()
  5.     {
  6.         return $this->execute(nullself::HYDRATE_ARRAY);
  7.     }
  8.     /**
  9.      * Gets one-dimensional array of results for the query.
  10.      *
  1.         $queryBuilder->setFirstResult($limit['start'])
  2.             ->setMaxResults($limit['max']);
  3.         $query $queryBuilder->setCacheable(true)->getQuery()->useQueryCache(true);
  4.         return $query->getArrayResult(Query::HYDRATE_ARRAY);
  5.     }
  6.     //  {{{ getListSpectacles()
  7.     /** Récupére la liste des spectacles
SpectaclesRepository->getRecommandedSpectacles() in /home/web/theatre-contemporain.net/dev/src/Controller/CritiquesController.php (line 961)
  1.         foreach ($listPossibleRecommandationNb as $key => $value) {
  2.             if ($value['totalRecommandation'] == 1) {
  3.                 unset($listPossibleRecommandationNb[$key]);
  4.             } else {
  5.                 /* just check if there is really at least 1 spectacle with the nb of recommandations because of a bug */
  6.                 $testSpectacleExist $spectacleRepo->getRecommandedSpectacles($value['totalRecommandation'], ['start' => 0'max' => 1]);
  7.                 if (empty($testSpectacleExist)) {
  8.                     unset($listPossibleRecommandationNb[$key]);
  9.                     continue;
  10.                 }
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.     Debug::enable();
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Stack Trace

FeatureNotImplemented
Doctrine\ORM\Cache\Exception\FeatureNotImplemented:
Second level cache does not support scalar results.

  at /home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/Exception/FeatureNotImplemented.php:11
  at Doctrine\ORM\Cache\Exception\FeatureNotImplemented::scalarResults()
     (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/DefaultQueryCache.php:234)
  at Doctrine\ORM\Cache\DefaultQueryCache->put()
     (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1286)
  at Doctrine\ORM\AbstractQuery->executeUsingQueryCache()
     (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:1163)
  at Doctrine\ORM\AbstractQuery->execute()
     (/home/web/theatre-contemporain.net/dev/vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php:913)
  at Doctrine\ORM\AbstractQuery->getArrayResult()
     (/home/web/theatre-contemporain.net/dev/vendor/theatre/core/src/Repository/SpectaclesRepository.php:2697)
  at TheatreCore\Repository\SpectaclesRepository->getRecommandedSpectacles()
     (/home/web/theatre-contemporain.net/dev/src/Controller/CritiquesController.php:961)
  at App\Controller\CritiquesController->action_recommandations()
     (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (/home/web/theatre-contemporain.net/dev/public/index.php:20)