PDOException: SQLSTATE[00000] [1040] Too many connections in spiralCore/components/dbal.php at line 107
spiralCore/components/dbal.php
97        {
98            $pdoDSN = $config['dbDriver'] . ':dbname=' . $config['dbName'];
99
100            if ($config['dbServer'])
101            {
102                //Server
103                $pdoDSN .= ';host=' . $config['dbServer'];
104            }
105
106            //Connection
107            self::$pdo = new PDO($pdoDSN, $config['dbUser'], $config['dbPassword'], $config['pdoOptions']);
108        }
109        catch (pdoException $pdoException)
110        {
111            self::$benchmarks['connection'] = microtime(true) - self::$benchmarks['connection'];
112            throw $pdoException;
113        }
114
115        self::$benchmarks['connection'] = microtime(true) - self::$benchmarks['connection'];
116        return self::$pdo;
117    }
spiralCore/components/orm/selector.php
463     * Fetch one object.
464     *
465     * @return ormObject
466     */
467    public function fetchOne()
468    {
469        //Only one line
470        $this->limit = 1;
471
472        //Object data (if childrens attached, result should be backed as numeric rowSet)
473        $objectsData = dbal::query($this->buildStatement(), dbal::select)->fetchRow(!$this->forceChildrens);
474
475        if (!$objectsData)
476        {
477            return self::createObject($this->table, array());
478        }
479
480        //Creation
481        if (!$this->forceChildrens)
482        {
483            //Fast selection
spiralApplication/actions/item.php
18     */
19    const cacheSimilar = 2592000;
20
21    /**
22     * Show item.
23     *
24     * @param int|bool $publicID
25     */
26    public function display($publicID = false)
27    {
28        $item = orm::items()->byPublicID((int)$publicID)->forceChildrens('meta', 'photo', 'vector')->fetchOne();
29        if (!$item->isLoaded() || $item->status != 'active')
30        {
31            self::callError('notFound');
32        }
33
34        //Metadata
35        $keywords = $item->meta->keywords;
36        $keywords = explode(',', $keywords);
37        if (count($keywords) < 2)
38        {
spiralCore/spiral.php
249                if (spiralDebug && !self::$globalConfig['spiral']['forceErrors'])
250                {
251                    throw new spiralException("Unable to call action '$action', uncallable method '$method'.");
252                }
253
254                self::callError('notFound');
255            }
256
257            spiralEvents::callEvent('callAction', $instance);
258
259            $actionResult = call_user_func_array(array($instance, $method), $arguments);
260            $actionResult = (string)call_user_func(array($instance, 'finishAction'), $actionResult);
261
262            spiralDebug && self::debugMessage("Action '$action' with method '$method' was successfully processed.");
263
264            if (!$parentAction)
265            {
266                //This action was a parent of request, output should finish processing.
267                self::closeOutput($actionResult);
268            }
269
3܃