|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-01 11:00 UTC] buhmann at teqneers dot de
[2005-04-15 14:02 UTC] buhmann at teqneers dot de
[2006-04-03 10:05 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 20:00:01 2025 UTC |
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 />'; ?>