From:             buhmann at teqneers dot de
Operating system: WIN2k/Win2003/XP
PHP version:      4.3.10
PHP Bug Type:     OCI8 related
Bug description:  Already reproducable Bug #20006 cannot use 2 database 
connections

Description:
------------
I have to fight with the same problem up to the current release (4.9.10).
It doesn't seems to be fixed. In my opinion adding more tnsnames to the
oracle client isn't help enough. the oracle user have to be enough.

I tried it on a win2k and win2003 server edition with oracle clients 8 and
9. always the same problem. opening the first connection works fine. also
doing some selects with this connection. but, after opening a second
connection and don't use it immediately, errors occurred. if i instead use
the second connection immediately (doing a select or anything), it will
also works correct. The errors will occurr (using the first connection)
until i will use the second connection.

Reproduce code:
---------------
<?php
        /* 
           test table 1, created on the first schema 'SCHEMA_1'
           ----------------------------
           create table test1 ( 
           dummy NUMBER(20) NOT NULL
                                 );  
           commit;
           ----------------------------
           
           test table 2, created on the second schema 'SCHEMA_2'
           ----------------------------
           create table test2 ( 
           dummy NUMBER(20) NOT NULL
                                 ); 
           commit;
           ----------------------------
        */

        function selectOne() { 
                global $connectionOne;
                
                $select         = 'SELECT * FROM test1';
                $stmt           = OCIPARSE( $connectionOne, $select );
                OCIExecute( $stmt );
                OCIFetchInto( $stmt, $arr, OCI_ASSOC );
                OCIFreeStatement( $stmt );     
        }
        
        function selectTwo() { 
                global $connectionTwo;
                
                $select         = 'SELECT * FROM test2';
                $stmt           = OCIPARSE( $connectionTwo, $select );
                OCIExecute( $stmt );
                OCIFetchInto( $stmt, $arr, OCI_ASSOC );
                OCIFreeStatement( $stmt );     
        }
        
        
        // make first connection
        $connectionOne = OCILogon( 'user1', 'pwd1', 'TNS' );
        
        
        // select again from table test1 (connection 1)
        echo '
        Start----- Test1 Con1 -----------------------<br />';
                selectOne();
        echo '
        End-------------------------------------------
        <br />
        <br />
        <br />';
        
        
        // make second connection
        $connectionTwo = OCILogon( 'user2', 'pwd2', 'TNS' );
        
        
        // select again from table test1 (connection 1), this will result in an
error
        echo '
        Start----- Test1 Con1 -----------------------<br />';
                selectOne();
// ===> if you will make a selectTwo() instead off a
// ===> selectOne() at this point, now errors occurr!
                //selectTwo();
        echo '
        End-------------------------------------------
        <br />
        <br />
        <br />';
        
        
        
        
        
        // select from table test1 (connection 1)
        echo '
        Start----- Test1 Con1 -----------------------<br />';
                selectOne();
        echo '
        End-------------------------------------------
        <br />
        <br />
        <br />';
        
        
        // select from table test2 (connection 2)
        echo '
        Start----- Test2 Con2 -----------------------<br />';
                selectTwo();
        echo '
        End-------------------------------------------
        <br />
        <br />
        <br />';
        
        
        // select again from table test1 (connection 1), this will work now
        echo '
        Start----- Test1 Con1 -----------------------<br />';
                selectOne();
        echo '
        End-------------------------------------------
        <br />
        <br />
        <br />';
?>


-- 
Edit bug report at http://bugs.php.net/?id=31898&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31898&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31898&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31898&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31898&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31898&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31898&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31898&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31898&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31898&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31898&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31898&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31898&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31898&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31898&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31898&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31898&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31898&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31898&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31898&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31898&r=mysqlcfg

Reply via email to