PHP 4.0 Bug #6033: Can't open more than one non-persistent connections to the same database
| From: | mlemos at acm dot org | Date: | Wed, 09 Aug 2000 02:37:34 +0000 |
| Subject: | PHP 4.0 Bug #6033: Can't open more than one non-persistent connections to the same database | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-28171@lists.php.net to get a copy of this message | ||
From: mlemos@acm.org
Operating system: Linux RH 6
PHP version: 4.0 Latest CVS (08/08/2000)
PHP Bug Type: Informix related
Bug description: Can't open more than one non-persistent connections to the same database
Since Informix PHP API do not close non-persistent connections in ifx_Close
but rather at the end of script, Informix client functions fail on a second
connection attempt when shared memory connections are used with error
-27000 Cannot support multiple connections over shared memory .
Try this script to see the problem.
<?
Function Doit($database_name,$some_table)
{
global $informix_server,$user,$password;
PutEnv("INFORMIXSERVER=$informix_server");
if(($connection=ifx_connect($database_name."@".$informix_server,$user,$password)))
{
if(($result=ifx_query("SELECT * FROM $some_table",$connection)))
ifx_free_result($result);
else
echo "Database: $database_name Query error: ".ifx_errormsg(),"\n";
ifx_Close($connection);
}
else
echo "Connection error: ".ifx_errormsg(),"\n";
}
$informix_server="demo_on";
$user="informix";
$password="password";
DoIt("sysmaster","informix.arc_ae_view");
DoIt("sysutils","informix.bar_action");
?>