http://pms.cmet.ustc.edu.cn/

Exceptions

An exception occurred in the driver: SQLSTATE[08004] [1040] Too many connections

Exceptions 3

Doctrine\DBAL\Exception\ DriverException

  1.             case 1364:
  2.             case 1566:
  3.                 return new NotNullConstraintViolationException($exception$query);
  4.         }
  5.         return new DriverException($exception$query);
  6.     }
  7. }
  1.     private function handleDriverException(
  2.         Driver\Exception $driverException,
  3.         ?Query $query
  4.     ): DriverException {
  5.         $this->exceptionConverter ??= $this->_driver->getExceptionConverter();
  6.         $exception                  $this->exceptionConverter->convert($driverException$query);
  7.         if ($exception instanceof ConnectionLost) {
  8.             $this->close();
  9.         }
in vendor/doctrine/dbal/src/Connection.php -> handleDriverException (line 1891)
  1.     }
  2.     /** @internal */
  3.     final public function convertException(Driver\Exception $e): DriverException
  4.     {
  5.         return $this->handleDriverException($enull);
  6.     }
  7.     /**
  8.      * @param array<int, mixed>|array<string, mixed>                               $params
  9.      * @param array<int, int|string|Type|null>|array<string, int|string|Type|null> $types
in vendor/doctrine/dbal/src/Connection.php -> convertException (line 380)
  1.         }
  2.         try {
  3.             $this->_conn $this->_driver->connect($this->params);
  4.         } catch (Driver\Exception $e) {
  5.             throw $this->convertException($e);
  6.         }
  7.         if ($this->autoCommit === false) {
  8.             $this->beginTransaction();
  9.         }
  1.             'https://github.com/doctrine/dbal/issues/4966',
  2.             'Connection::getWrappedConnection() is deprecated.'
  3.                 ' Use Connection::getNativeConnection() to access the native connection.',
  4.         );
  5.         $this->connect();
  6.         return $this->_conn;
  7.     }
  8.     /** @return resource|object */
in vendor/doctrine/dbal/src/Connection.php -> getWrappedConnection (line 1082)
  1.     ): Result {
  2.         if ($qcp !== null) {
  3.             return $this->executeCacheQuery($sql$params$types$qcp);
  4.         }
  5.         $connection $this->getWrappedConnection();
  6.         $logger $this->_config->getSQLLogger();
  7.         if ($logger !== null) {
  8.             $logger->startQuery($sql$params$types);
  9.         }
  1.      *
  2.      * @return Result
  3.      */
  4.     public function execute(Connection $conn, array $params, array $types)
  5.     {
  6.         return $conn->executeQuery($this->sqlStatements$params$types$this->queryCacheProfile);
  7.     }
  8. }
in vendor/doctrine/orm/src/Query.php -> execute (line 327)
  1.             $sqlParams,
  2.             $types,
  3.             $this->_em->getConnection()->getParams()
  4.         );
  5.         return $executor->execute($this->_em->getConnection(), $sqlParams$types);
  6.     }
  7.     /**
  8.      * @param array<string,mixed> $sqlParams
  9.      * @param array<string,Type>  $types
in vendor/doctrine/orm/src/AbstractQuery.php -> _doExecute (line 1212)
  1.             $setCacheEntry = static function ($data) use ($cache$result$cacheItem$realCacheKey): void {
  2.                 $cache->save($cacheItem->set($result + [$realCacheKey => $data]));
  3.             };
  4.         }
  5.         $stmt $this->_doExecute();
  6.         if (is_numeric($stmt)) {
  7.             $setCacheEntry($stmt);
  8.             return $stmt;
in vendor/doctrine/orm/src/AbstractQuery.php -> executeIgnoreQueryCache (line 1166)
  1.     {
  2.         if ($this->cacheable && $this->isCacheEnabled()) {
  3.             return $this->executeUsingQueryCache($parameters$hydrationMode);
  4.         }
  5.         return $this->executeIgnoreQueryCache($parameters$hydrationMode);
  6.     }
  7.     /**
  8.      * Execute query ignoring second level cache.
  9.      *
  1.      *
  2.      * @return mixed
  3.      */
  4.     public function getResult($hydrationMode self::HYDRATE_OBJECT)
  5.     {
  6.         return $this->execute(null$hydrationMode);
  7.     }
  8.     /**
  9.      * Gets the array of results for the query.
  10.      *
AbstractQuery->getResult() in src/Repository/BatchRepository.php (line 36)
  1.         $dql 'SELECT b from App:Batch b WHERE b.open <=:today AND b.applyDeadline >= :today ORDER BY b.open DESC';
  2.         $query $this->getEntityManager()
  3.             ->createQuery($dql)
  4.             ->setParameter('today'$today);
  5.         
  6.         return $query->getResult();
  7.     }
  8. }
BatchRepository->getCurrents() in src/Controller/DefaultController.php (line 29)
  1.      *
  2.      * @Route("/", name="homepage")
  3.      */
  4.     public function homepage(EntityManagerInterface $em): Response
  5.     {
  6.         $batches $em->getRepository(Batch::class)->getCurrents();
  7.         $announcements $em->getRepository(Announcement::class)->last();
  8.         $currentReviewBatch $em->getRepository(ReviewBatch::class)->findOneByCurrent(true);
  9.         return $this->render('default/homepage.html.twig', [
  10.             'batches' => $batches,
  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.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Doctrine\DBAL\Driver\PDO\ Exception

SQLSTATE[08004] [1040] Too many connections

  1.         } else {
  2.             $code     $exception->getCode();
  3.             $sqlState null;
  4.         }
  5.         return new self($exception->getMessage(), $sqlState$code$exception);
  6.     }
  7. }
  1.                 $params['user'] ?? '',
  2.                 $params['password'] ?? '',
  3.                 $driverOptions,
  4.             );
  5.         } catch (PDOException $exception) {
  6.             throw Exception::new($exception);
  7.         }
  8.         return new Connection($pdo);
  9.     }
  1.      */
  2.     public function connect(
  3.         #[SensitiveParameter]
  4.         array $params
  5.     ) {
  6.         return $this->wrappedDriver->connect($params);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
  1.         $this->connectionName $connectionName;
  2.     }
  3.     public function connect(array $params): ConnectionInterface
  4.     {
  5.         $connection parent::connect($params);
  6.         if ('void' !== (string) (new \ReflectionMethod(DriverInterface\Connection::class, 'commit'))->getReturnType()) {
  7.             return new DBAL3\Connection(
  8.                 $connection,
  9.                 $this->debugDataHolder,
  1.         if ($this->_conn !== null) {
  2.             return false;
  3.         }
  4.         try {
  5.             $this->_conn $this->_driver->connect($this->params);
  6.         } catch (Driver\Exception $e) {
  7.             throw $this->convertException($e);
  8.         }
  9.         if ($this->autoCommit === false) {
  1.             'https://github.com/doctrine/dbal/issues/4966',
  2.             'Connection::getWrappedConnection() is deprecated.'
  3.                 ' Use Connection::getNativeConnection() to access the native connection.',
  4.         );
  5.         $this->connect();
  6.         return $this->_conn;
  7.     }
  8.     /** @return resource|object */
in vendor/doctrine/dbal/src/Connection.php -> getWrappedConnection (line 1082)
  1.     ): Result {
  2.         if ($qcp !== null) {
  3.             return $this->executeCacheQuery($sql$params$types$qcp);
  4.         }
  5.         $connection $this->getWrappedConnection();
  6.         $logger $this->_config->getSQLLogger();
  7.         if ($logger !== null) {
  8.             $logger->startQuery($sql$params$types);
  9.         }
  1.      *
  2.      * @return Result
  3.      */
  4.     public function execute(Connection $conn, array $params, array $types)
  5.     {
  6.         return $conn->executeQuery($this->sqlStatements$params$types$this->queryCacheProfile);
  7.     }
  8. }
in vendor/doctrine/orm/src/Query.php -> execute (line 327)
  1.             $sqlParams,
  2.             $types,
  3.             $this->_em->getConnection()->getParams()
  4.         );
  5.         return $executor->execute($this->_em->getConnection(), $sqlParams$types);
  6.     }
  7.     /**
  8.      * @param array<string,mixed> $sqlParams
  9.      * @param array<string,Type>  $types
in vendor/doctrine/orm/src/AbstractQuery.php -> _doExecute (line 1212)
  1.             $setCacheEntry = static function ($data) use ($cache$result$cacheItem$realCacheKey): void {
  2.                 $cache->save($cacheItem->set($result + [$realCacheKey => $data]));
  3.             };
  4.         }
  5.         $stmt $this->_doExecute();
  6.         if (is_numeric($stmt)) {
  7.             $setCacheEntry($stmt);
  8.             return $stmt;
in vendor/doctrine/orm/src/AbstractQuery.php -> executeIgnoreQueryCache (line 1166)
  1.     {
  2.         if ($this->cacheable && $this->isCacheEnabled()) {
  3.             return $this->executeUsingQueryCache($parameters$hydrationMode);
  4.         }
  5.         return $this->executeIgnoreQueryCache($parameters$hydrationMode);
  6.     }
  7.     /**
  8.      * Execute query ignoring second level cache.
  9.      *
  1.      *
  2.      * @return mixed
  3.      */
  4.     public function getResult($hydrationMode self::HYDRATE_OBJECT)
  5.     {
  6.         return $this->execute(null$hydrationMode);
  7.     }
  8.     /**
  9.      * Gets the array of results for the query.
  10.      *
AbstractQuery->getResult() in src/Repository/BatchRepository.php (line 36)
  1.         $dql 'SELECT b from App:Batch b WHERE b.open <=:today AND b.applyDeadline >= :today ORDER BY b.open DESC';
  2.         $query $this->getEntityManager()
  3.             ->createQuery($dql)
  4.             ->setParameter('today'$today);
  5.         
  6.         return $query->getResult();
  7.     }
  8. }
BatchRepository->getCurrents() in src/Controller/DefaultController.php (line 29)
  1.      *
  2.      * @Route("/", name="homepage")
  3.      */
  4.     public function homepage(EntityManagerInterface $em): Response
  5.     {
  6.         $batches $em->getRepository(Batch::class)->getCurrents();
  7.         $announcements $em->getRepository(Announcement::class)->last();
  8.         $currentReviewBatch $em->getRepository(ReviewBatch::class)->findOneByCurrent(true);
  9.         return $this->render('default/homepage.html.twig', [
  10.             'batches' => $batches,
  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.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

PDOException

SQLSTATE[08004] [1040] Too many connections

  1.         $safeParams $params;
  2.         unset($safeParams['password'], $safeParams['url']);
  3.         try {
  4.             $pdo = new PDO(
  5.                 $this->constructPdoDsn($safeParams),
  6.                 $params['user'] ?? '',
  7.                 $params['password'] ?? '',
  8.                 $driverOptions,
  9.             );
  10.         } catch (PDOException $exception) {
  1.         $safeParams $params;
  2.         unset($safeParams['password'], $safeParams['url']);
  3.         try {
  4.             $pdo = new PDO(
  5.                 $this->constructPdoDsn($safeParams),
  6.                 $params['user'] ?? '',
  7.                 $params['password'] ?? '',
  8.                 $driverOptions,
  9.             );
  10.         } catch (PDOException $exception) {
  1.      */
  2.     public function connect(
  3.         #[SensitiveParameter]
  4.         array $params
  5.     ) {
  6.         return $this->wrappedDriver->connect($params);
  7.     }
  8.     /**
  9.      * {@inheritDoc}
  10.      */
  1.         $this->connectionName $connectionName;
  2.     }
  3.     public function connect(array $params): ConnectionInterface
  4.     {
  5.         $connection parent::connect($params);
  6.         if ('void' !== (string) (new \ReflectionMethod(DriverInterface\Connection::class, 'commit'))->getReturnType()) {
  7.             return new DBAL3\Connection(
  8.                 $connection,
  9.                 $this->debugDataHolder,
  1.         if ($this->_conn !== null) {
  2.             return false;
  3.         }
  4.         try {
  5.             $this->_conn $this->_driver->connect($this->params);
  6.         } catch (Driver\Exception $e) {
  7.             throw $this->convertException($e);
  8.         }
  9.         if ($this->autoCommit === false) {
  1.             'https://github.com/doctrine/dbal/issues/4966',
  2.             'Connection::getWrappedConnection() is deprecated.'
  3.                 ' Use Connection::getNativeConnection() to access the native connection.',
  4.         );
  5.         $this->connect();
  6.         return $this->_conn;
  7.     }
  8.     /** @return resource|object */
in vendor/doctrine/dbal/src/Connection.php -> getWrappedConnection (line 1082)
  1.     ): Result {
  2.         if ($qcp !== null) {
  3.             return $this->executeCacheQuery($sql$params$types$qcp);
  4.         }
  5.         $connection $this->getWrappedConnection();
  6.         $logger $this->_config->getSQLLogger();
  7.         if ($logger !== null) {
  8.             $logger->startQuery($sql$params$types);
  9.         }
  1.      *
  2.      * @return Result
  3.      */
  4.     public function execute(Connection $conn, array $params, array $types)
  5.     {
  6.         return $conn->executeQuery($this->sqlStatements$params$types$this->queryCacheProfile);
  7.     }
  8. }
in vendor/doctrine/orm/src/Query.php -> execute (line 327)
  1.             $sqlParams,
  2.             $types,
  3.             $this->_em->getConnection()->getParams()
  4.         );
  5.         return $executor->execute($this->_em->getConnection(), $sqlParams$types);
  6.     }
  7.     /**
  8.      * @param array<string,mixed> $sqlParams
  9.      * @param array<string,Type>  $types
in vendor/doctrine/orm/src/AbstractQuery.php -> _doExecute (line 1212)
  1.             $setCacheEntry = static function ($data) use ($cache$result$cacheItem$realCacheKey): void {
  2.                 $cache->save($cacheItem->set($result + [$realCacheKey => $data]));
  3.             };
  4.         }
  5.         $stmt $this->_doExecute();
  6.         if (is_numeric($stmt)) {
  7.             $setCacheEntry($stmt);
  8.             return $stmt;
in vendor/doctrine/orm/src/AbstractQuery.php -> executeIgnoreQueryCache (line 1166)
  1.     {
  2.         if ($this->cacheable && $this->isCacheEnabled()) {
  3.             return $this->executeUsingQueryCache($parameters$hydrationMode);
  4.         }
  5.         return $this->executeIgnoreQueryCache($parameters$hydrationMode);
  6.     }
  7.     /**
  8.      * Execute query ignoring second level cache.
  9.      *
  1.      *
  2.      * @return mixed
  3.      */
  4.     public function getResult($hydrationMode self::HYDRATE_OBJECT)
  5.     {
  6.         return $this->execute(null$hydrationMode);
  7.     }
  8.     /**
  9.      * Gets the array of results for the query.
  10.      *
AbstractQuery->getResult() in src/Repository/BatchRepository.php (line 36)
  1.         $dql 'SELECT b from App:Batch b WHERE b.open <=:today AND b.applyDeadline >= :today ORDER BY b.open DESC';
  2.         $query $this->getEntityManager()
  3.             ->createQuery($dql)
  4.             ->setParameter('today'$today);
  5.         
  6.         return $query->getResult();
  7.     }
  8. }
BatchRepository->getCurrents() in src/Controller/DefaultController.php (line 29)
  1.      *
  2.      * @Route("/", name="homepage")
  3.      */
  4.     public function homepage(EntityManagerInterface $em): Response
  5.     {
  6.         $batches $em->getRepository(Batch::class)->getCurrents();
  7.         $announcements $em->getRepository(Announcement::class)->last();
  8.         $currentReviewBatch $em->getRepository(ReviewBatch::class)->findOneByCurrent(true);
  9.         return $this->render('default/homepage.html.twig', [
  10.             'batches' => $batches,
  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.         $this->request $request;
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         $response->send();
  7.         if ($this->kernel instanceof TerminableInterface) {
  8.             $this->kernel->terminate($this->request$response);
  9.         }
in vendor/autoload_runtime.php -> run (line 35)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/home/projects/pms/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. use App\Kernel;
  3. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  4. return function (array $context) {
  5.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  6. };

Stack Traces 3

[3/3] DriverException
Doctrine\DBAL\Exception\DriverException:
An exception occurred in the driver: SQLSTATE[08004] [1040] Too many connections

  at vendor/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php:117
  at Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter->convert()
     (vendor/doctrine/dbal/src/Connection.php:1943)
  at Doctrine\DBAL\Connection->handleDriverException()
     (vendor/doctrine/dbal/src/Connection.php:1891)
  at Doctrine\DBAL\Connection->convertException()
     (vendor/doctrine/dbal/src/Connection.php:380)
  at Doctrine\DBAL\Connection->connect()
     (vendor/doctrine/dbal/src/Connection.php:1659)
  at Doctrine\DBAL\Connection->getWrappedConnection()
     (vendor/doctrine/dbal/src/Connection.php:1082)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor/doctrine/orm/src/Query/Exec/SingleSelectExecutor.php:33)
  at Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute()
     (vendor/doctrine/orm/src/Query.php:327)
  at Doctrine\ORM\Query->_doExecute()
     (vendor/doctrine/orm/src/AbstractQuery.php:1212)
  at Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache()
     (vendor/doctrine/orm/src/AbstractQuery.php:1166)
  at Doctrine\ORM\AbstractQuery->execute()
     (vendor/doctrine/orm/src/AbstractQuery.php:901)
  at Doctrine\ORM\AbstractQuery->getResult()
     (src/Repository/BatchRepository.php:36)
  at App\Repository\BatchRepository->getCurrents()
     (src/Controller/DefaultController.php:29)
  at App\Controller\DefaultController->homepage()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)                
[2/3] Exception
Doctrine\DBAL\Driver\PDO\Exception:
SQLSTATE[08004] [1040] Too many connections

  at vendor/doctrine/dbal/src/Driver/PDO/Exception.php:28
  at Doctrine\DBAL\Driver\PDO\Exception::new()
     (vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:40)
  at Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect()
     (vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29)
  at Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect()
     (vendor/symfony/doctrine-bridge/Middleware/Debug/Driver.php:41)
  at Symfony\Bridge\Doctrine\Middleware\Debug\Driver->connect()
     (vendor/doctrine/dbal/src/Connection.php:378)
  at Doctrine\DBAL\Connection->connect()
     (vendor/doctrine/dbal/src/Connection.php:1659)
  at Doctrine\DBAL\Connection->getWrappedConnection()
     (vendor/doctrine/dbal/src/Connection.php:1082)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor/doctrine/orm/src/Query/Exec/SingleSelectExecutor.php:33)
  at Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute()
     (vendor/doctrine/orm/src/Query.php:327)
  at Doctrine\ORM\Query->_doExecute()
     (vendor/doctrine/orm/src/AbstractQuery.php:1212)
  at Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache()
     (vendor/doctrine/orm/src/AbstractQuery.php:1166)
  at Doctrine\ORM\AbstractQuery->execute()
     (vendor/doctrine/orm/src/AbstractQuery.php:901)
  at Doctrine\ORM\AbstractQuery->getResult()
     (src/Repository/BatchRepository.php:36)
  at App\Repository\BatchRepository->getCurrents()
     (src/Controller/DefaultController.php:29)
  at App\Controller\DefaultController->homepage()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)                
[1/3] PDOException
PDOException:
SQLSTATE[08004] [1040] Too many connections

  at vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34
  at PDO->__construct()
     (vendor/doctrine/dbal/src/Driver/PDO/MySQL/Driver.php:34)
  at Doctrine\DBAL\Driver\PDO\MySQL\Driver->connect()
     (vendor/doctrine/dbal/src/Driver/Middleware/AbstractDriverMiddleware.php:29)
  at Doctrine\DBAL\Driver\Middleware\AbstractDriverMiddleware->connect()
     (vendor/symfony/doctrine-bridge/Middleware/Debug/Driver.php:41)
  at Symfony\Bridge\Doctrine\Middleware\Debug\Driver->connect()
     (vendor/doctrine/dbal/src/Connection.php:378)
  at Doctrine\DBAL\Connection->connect()
     (vendor/doctrine/dbal/src/Connection.php:1659)
  at Doctrine\DBAL\Connection->getWrappedConnection()
     (vendor/doctrine/dbal/src/Connection.php:1082)
  at Doctrine\DBAL\Connection->executeQuery()
     (vendor/doctrine/orm/src/Query/Exec/SingleSelectExecutor.php:33)
  at Doctrine\ORM\Query\Exec\SingleSelectExecutor->execute()
     (vendor/doctrine/orm/src/Query.php:327)
  at Doctrine\ORM\Query->_doExecute()
     (vendor/doctrine/orm/src/AbstractQuery.php:1212)
  at Doctrine\ORM\AbstractQuery->executeIgnoreQueryCache()
     (vendor/doctrine/orm/src/AbstractQuery.php:1166)
  at Doctrine\ORM\AbstractQuery->execute()
     (vendor/doctrine/orm/src/AbstractQuery.php:901)
  at Doctrine\ORM\AbstractQuery->getResult()
     (src/Repository/BatchRepository.php:36)
  at App\Repository\BatchRepository->getCurrents()
     (src/Controller/DefaultController.php:29)
  at App\Controller\DefaultController->homepage()
     (vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:35)
  at require_once('/home/projects/pms/vendor/autoload_runtime.php')
     (public/index.php:5)