我正在使用Yii和Postgres数据库中的应用程序。当我在实时服务器(而不是本地系统)上运行应用程序时,我收到此错误
CDbConnection无法打开数据库连接:SQLSTATE [7006] [7]无法连接到服务器:没有可用的缓冲区空间(0x00002747 / 10055)服务器是否在主机“localhost”上运行并接受端口上的TCP / IP连接5432?“
当我与服务器支持团队联系时,他们告诉每次交易后关闭数据库连接。我想知道如何在使用PostgreSQL的yii中的每个事务之后关闭数据库连接?
这是main.php中的数据库连接代码
'db'=>array( 'class'=>'CDbConnection', 'connectionString' => 'pgsql:host=localhost;port=5432;dbname=crescent_6', 'emulatePrepare' => true, 'username' => 'postgres', 'password' => 'root', 'charset' => 'utf8', ), 'cache' => array ( 'class' => 'system.caching.CDbCache', ),