|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6033 Can't open more than one non-persistent connections to the same database
Submitted: 2000-08-08 22:37 UTC Modified: 2000-08-12 00:52 UTC
From: mlemos at acm dot org Assigned: danny (profile)
Status: Closed Package: Informix related
PHP Version: 4.0 Latest CVS (08/08/2000) OS: Linux RH 6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
24 + 43 = ?
Subscribe to this entry?

 [2000-08-08 22:37 UTC] mlemos at acm dot org
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;
  if(($result=ifx_query("SELECT * FROM $some_table",$connection)))
   echo "Database: $database_name Query error: ".ifx_errormsg(),"\n";
  echo "Connection error: ".ifx_errormsg(),"\n";




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-10 04:00 UTC]
One solution is not to use shared memory connections
(ipcshm) but streams pipes (ipcstr) if you have them,
or tcp/ip (tlitcp or soctcp). It is the recommended way.
Despite what the manual says, ipcshm is not always faster,
it depends on the OS.

Even if you use shared memory connections you can
access as many different databases as you like with
the database:table syntax using one single connection.
You can even have transactions involving different databases
this way. It is certainly more efficient.


 [2000-08-11 22:21 UTC]
I will try to restore the PHP3 behaviour but it will take
some thinking because Zend does not release the connection
resource until the script ends, and that is a complication.

I will possibly add a "connection closed" flag internally 
so that I can re-open it when Zend recycles the existing resource.

Thanks for the feedback.

 [2000-08-12 00:52 UTC]
I think I have fixed it, and PHP3 behaviour is restored : ifx_close() now 
really closes the connection. ifx_connect() still recycles the existing
Zend resource but will silently reconnect behind the scenes if needed.

Multiple calls to ifx_connect() for the same link without ifx_close()
reuse the existing connection as before.

Please test & let me know if this solves your problem.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 27 23:01:30 2024 UTC