#11486 [Bgs->]: Oracle connection resource disappears in nested connections

From: Date: Mon, 19 Aug 2002 14:52:07 +0000
Subject: #11486 [Bgs->]: Oracle connection resource disappears in nested connections
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17200@lists.php.net to get a copy of this message
ID: 11486 Updated by: thies@php.net Reported By: alban.hertroys@ddnh.nl -Status: Bogus +Status: Won't fix Bug Type: Oracle related Operating System: Debian Linux i686 PHP Version: 4.0.4pl1 New Comment: i'm almost sure this problem is still in the code. the workaround would be to have two different TNS names for the same database and use them in the ora_logon call. if you use oracle client > 8.0 you should be using the newer and more powerful oci*() interface to talk to your database (event < 8.0) and use ocinlogon to force transaction isolation. Previous Comments: ------------------------------------------------------------------------ [2002-08-19 10:30:46] kalowsky@php.net No, I can't do better than marking it bogus. I don't have a copy of Oracle, nor is 4.0.5 the latest PHP. There were massive changes to the code between 4.0 and 4.1, and then from 4.1 to 4.2. There is no more work being done on the 4.0 branch, thus if you wish to have this bug fixed you need a newer version. ------------------------------------------------------------------------ [2002-08-19 10:27:39] alban.hertroys@ddnh.nl That won't be quite possible. I use the combination of this PHP-version (by now it's PHP4.05something) and Oracle at work. I am certain that I cannot persuade my colleagues to use an untested (= recent) version of PHP4. It is very easy to test if you can reproduce this bug, if you have a recent version of PHP and Oracle available. But I haven't, so someone else'll have to try. It's a bit easy to mark a bug-report as "bogus" just because it was submitted more than a year ago. You can do better than that, can't you? ------------------------------------------------------------------------ [2002-08-17 01:39:59] kalowsky@php.net Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. ------------------------------------------------------------------------ [2001-06-14 09:13:25] alban.hertroys@ddnh.nl If you do the following, the last ora_commit has a connection resource of type "unknown". The connection is gone! With PHP3 this worked, as a new connection resource was opened for every ora_logon. In PHP4 the resource is being reused. The ora_commit in the function is valid (type is "oracle link"). <?php define("username", "xxx"); define("password", "xxx"); function func1() { $conn = ora_logon(username, password); if (! $conn) die ("No connection"); ora_commitoff($conn); $curs = ora_open($conn); ora_parse($curs, "SELECT 1 FROM dual"); ora_exec($curs); ora_close($curs); ora_commit($conn); ora_logoff($conn); } $conn = ora_logon(username, password); if (! $conn) die ("No connection"); ora_commitoff($conn); func1(); func1(); $curs = ora_open($conn); ora_parse($curs, "SELECT 1 FROM dual"); ora_exec($curs); ora_close($curs); ora_commit($conn); ora_logoff($conn); ?> This results in: Warning: Connection already closed for cursor index 138323132 in /home/alban/public_htdocs/test/nested_connections.php on line 28 Warning: Connection already closed for cursor index 138323132 in /home/alban/public_htdocs/test/nested_connections.php on line 29 Warning: 1 is not a valid Oracle-Connection resource in /home/alban/public_htdocs/test/nested_connections.php on line 32 Warning: 1 is not a valid Oracle-Connection resource in /home/alban/public_htdocs/test/nested_connections.php on line 33 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=11486&edit=1

« previous php.bugs (#17200) next »