[PHP-DEV] Bug #11486: Oracle connection resource disappears in nested connections From: alban.hertroys <email protected>
Date: 06/14/01

From: alban.hertroys <email protected>
Operating system: Debian Linux i686
PHP version: 4.0.4pl1
PHP Bug Type: Oracle related
Bug description: Oracle connection resource disappears in nested connections

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 Bug report at: http://bugs.php.net/?id=11486&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>