Re: PHP 4.0 Bug #6033 Updated: Can't open more than one non-persistent connections to the same database
| From: | Danny Heijl | Date: | Sat, 12 Aug 2000 12:19:27 +0000 |
| Subject: | Re: PHP 4.0 Bug #6033 Updated: Can't open more than one non-persistent connections to the same database | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-28682@lists.php.net to get a copy of this message | ||
I think this time it is *really* fixed, at least your test
script now works with both ipcshm and soctcp connections.
My own test script worked because it still had a reference to the
closed link (using different connection variables).
Yours didn't because you reused the same variable, and assigning
the second connection to it removed the last reference, triggering
the destructor which (wrongly) tried to close again but closed
the current (new) connection instead.
Thanks again for the testing & feedback.
Danny
---
Manuel Lemos wrote:
....
>
> No, the problem seems to remain in PHP 4. It seems to work in PHP 3. Try
> this test script:
>
> <?
>
> Function Doit($database_name,$some_table)
> {
> global $informix_server,$user,$password;
>
> PutEnv("INFORMIXSERVER=$informix_server");
> if(($connection=ifx_connect("@".$informix_server,$user,$password)))
> {
> if(($result=ifx_query("DATABASE $database_name",$connection)))
> {
> echo "Database: $database_name, Result: $result\n";
> ifx_free_result($result);
> if(($result=ifx_query("SELECT * FROM
> $some_table",$connection)))
> {
> echo "Table: $some_table, Result: $result\n";
> ifx_free_result($result);
> }
> else
> echo "Database: $database_name Query error:
> ".ifx_errormsg(),"\n";
> }
> 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="someuser";
> $password="somepassword";
> DoIt("sysmaster","informix.arc_ae_view");
> $user="anotheruser";
> $password="anotherpassword";
> DoIt("sysutils","informix.bar_action");
>
> ?>
>
> Regards,
> Manuel Lemos
>
> Web Programming Components using PHP Classes.
> Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
> --
> E-mail: mlemos@acm.org
> URL: http://www.mlemos.e-na.net/
> PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
> --