From c0ee49fe88c44f582ed7a906b165e8aab82dfad9 Mon Sep 17 00:00:00 2001 From: AD7six Date: Fri, 23 Jan 2015 08:30:26 +0000 Subject: [PATCH] Remove callbacks to speed up saving --- lib/Cake/Model/Datasource/Session/DatabaseSession.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Model/Datasource/Session/DatabaseSession.php b/lib/Cake/Model/Datasource/Session/DatabaseSession.php index ff3696236..e59a4a152 100644 --- a/lib/Cake/Model/Datasource/Session/DatabaseSession.php +++ b/lib/Cake/Model/Datasource/Session/DatabaseSession.php @@ -118,10 +118,11 @@ class DatabaseSession implements CakeSessionHandlerInterface { $record = compact('id', 'data', 'expires'); $record[$this->_model->primaryKey] = $id; + $options = array('validate' => false, 'callbacks' => false); try { - return $this->_model->save($record, array('validate' => false)); + return $this->_model->save($record, $options); } catch (PDOException $e) { - return $this->_model->save($record, array('validate' => false)); + return $this->_model->save($record, $options); } }