diff --git a/lib/Cake/Model/Datasource/Session/DatabaseSession.php b/lib/Cake/Model/Datasource/Session/DatabaseSession.php index 932a5f5fc..ff3696236 100644 --- a/lib/Cake/Model/Datasource/Session/DatabaseSession.php +++ b/lib/Cake/Model/Datasource/Session/DatabaseSession.php @@ -119,9 +119,9 @@ class DatabaseSession implements CakeSessionHandlerInterface { $record[$this->_model->primaryKey] = $id; try { - return $this->_model->save($record); + return $this->_model->save($record, array('validate' => false)); } catch (PDOException $e) { - return $this->_model->save($record); + return $this->_model->save($record, array('validate' => false)); } } diff --git a/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php b/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php index 84ea546ee..a0c6b30a3 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php +++ b/lib/Cake/Test/Case/Model/Datasource/Session/DatabaseSessionTest.php @@ -213,31 +213,16 @@ class DatabaseSessionTest extends CakeTestCase { ->method('exists') ->will($this->returnValue(false)); - // First validate - $mockedModel->expects($this->at($counter++)) - ->method('exists') - ->will($this->returnValue(false)); - // Second save $mockedModel->expects($this->at($counter++)) ->method('exists') ->will($this->returnValue(false)); - // Second validate - $mockedModel->expects($this->at($counter++)) - ->method('exists') - ->will($this->returnValue(false)); - // Second save retry $mockedModel->expects($this->at($counter++)) ->method('exists') ->will($this->returnValue(true)); - // Second validate retry - $mockedModel->expects($this->at($counter++)) - ->method('exists') - ->will($this->returnValue(false)); - // Datasource exists check $mockedModel->expects($this->at($counter++)) ->method('exists')