|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-03-25 10:33 UTC] gioppo at csi dot it
Description: ------------ Making a connection using OCILogon in a webfar with 4 server against a single Oracle DB we get a ORA-24327 error but not everytime. Some time it connects sometimes not. It seems that it should have been correcte on CVS but apparently it doesn' any hint on how to solve this problem? PHP API 20020918 PHP Extension 20020429 Zend Extension 20021010 Thread Safety disabled Apache Version Apache/1.3.29 Apache Release 10329100 Apache API Version 19990320 OCI8 Support enabled Revision $Revision: 1.183.2.5 $ Oracle Version 8.1 Reproduce code: --------------- We use adodb PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 21:00:01 2025 UTC |
We probably solved the problem bypassing tnsnames.ora. We made the connection using tnsnames defined alias and it got errors sometime. Here is a chunk of php code (we used method b which gave errors sometime, when we used d mode we always manage to make connection) any hint? A problem on finding tnsnames? NOTE OCILogon is a php library function so no hint on how to modify it, but the behaviour meke me think about an environment problem: we have a Compile-time ORACLE_HOME /oracle_home for compiling OCI for php but ORACLE_HOME /oracle817/app/oracle/product/8.1.7 _ENV["ORACLE_HOME"] /oracle817/app/oracle/product/8.1.7 on env for apache and php (/oracle_home is a symbolic link to the /oracle817/app/oracle/product/8.1.7 folder) could be that the OCI8 so compiled have trouble on traversing the link? /* Multiple modes of connection are supported: a. Local Database $conn->Connect(false,'scott','tiger'); b. From tnsnames.ora $conn->Connect(false,'scott','tiger',$tnsname); $conn->Connect($tnsname,'scott','tiger'); c. Server + service name $conn->Connect($serveraddress,'scott,'tiger',$service_name); d. Server + SID $conn->connectSID = true; $conn->Connect($serveraddress,'scott,'tiger',$SID); Example TNSName: --------------- NATSOFT.DOMAIN = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = kermit)(PORT = 1523)) ) (CONNECT_DATA = (SERVICE_NAME = natsoft.domain) ) ) There are 3 connection modes, 0 = non-persistent, 1 = persistent, 2 = force new connection */ function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$mode=0) { $this->_errorMsg = false; $this->_errorCode = false; if($argHostname) { // added by Jorma Tuomainen <jorma.tuomainen@ppoy.fi> if (empty($argDatabasename)) $argDatabasename = $argHostname; else { if(strpos($argHostname,":")) { $argHostinfo=explode(":",$argHostname); $argHostname=$argHostinfo[0]; $argHostport=$argHostinfo[1]; } else { $argHostport="1521"; } if ($this->connectSID) { $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname .")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))"; } else $argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname .")(PORT=$argHostport))(CONNECT_DATA=(SERVICE_NAME=$argDatabasename)))"; } } if ($mode==1) { $this->_connectionID = OCIPLogon($argUsername,$argPassword, $argDatabasename); if ($this->_connectionID && $this->autoRollback) OCIrollback($this->_connectionID); } else if ($mode==2) { $this->_connectionID = OCINLogon($argUsername,$argPassword, $argDatabasename); } else { $this->_connectionID = OCILogon($argUsername,$argPassword, $argDatabasename); } if ($this->_connectionID === false) return false;