From ba59fad873be047ba1d54054e597082cf138d49b Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 30 Nov 2007 22:23:57 +0000 Subject: [PATCH] Adding non-persistent connection fix for MS SQL (Ticket #3454) git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6097 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/model/datasources/dbo/dbo_mssql.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cake/libs/model/datasources/dbo/dbo_mssql.php b/cake/libs/model/datasources/dbo/dbo_mssql.php index 6d2dce3ef..2af840648 100644 --- a/cake/libs/model/datasources/dbo/dbo_mssql.php +++ b/cake/libs/model/datasources/dbo/dbo_mssql.php @@ -73,7 +73,6 @@ class DboMssql extends DboSource { 'password' => '', 'database' => 'cake', 'port' => '1433', - 'connect' => 'mssql_pconnect' ); /** * MS SQL column definition @@ -136,11 +135,17 @@ class DboMssql extends DboSource { } else { $port = '\\' . $config['port']; // Named pipe } - $this->connection = $connect($config['host'] . $port, $config['login'], $config['password']); + + if (!$config['persistent'] || (isset($config['connect']) && $config['connect'] === 'mssql_connect')) { + $this->connection = $connect($config['host'] . $port, $config['login'], $config['password'], true); + } else { + $this->connection = $connect($config['host'] . $port, $config['login'], $config['password']); + } if (mssql_select_db($config['database'], $this->connection)) { $this->connected = true; } + pr($this->connection); } /** * Disconnects from database.