Persistent Oracle Login & Connection Loss Detection?

From: Date: Wed, 18 Oct 2000 06:04:12 +0000
Subject: Persistent Oracle Login & Connection Loss Detection?
Groups: php.db 
Request: Send a blank email to php-db+get-3708@lists.php.net to get a copy of this message
Hi, I am having the same problem on WinNT 4, SP6a, Oracle8i (Release 2), IIS4. I do get a slightly differnt text though. "Need explicit attach before connecting". Florian Original Message: Hi all, hopefully someone can help me with this peculiar problem. I have a large number of Oracle driven pages that all php require() an Oracle login file. In the file I use the standard OCIPLogon() command to establish a persistent connection to my 8.0.6 database server, I never call OCILogOff(). This works wonderfully and I get persistent connections that are reused for all of my pages. The problem occurs when the Oracle server is rebooted. After that, all of my pages start showing: Warning: OCIStmtExecute: ORA-03114: not connected to ORACLE in /usr/local/apache/htdocs/product/show-status-table.php on line 14 I tried to change my included login file to do something like: if ( ! ($dbConn = OCIPLogon(user, pass, DB)) ) { OCILogOff($dbConn); OCIPLogon(user, pass, DB); } else $dbConn = OCIPLogon(user, pass, DB); But that didn't work, and if or if not $dbConn doesn't work either. Does anyone have any ideas how I can detect this condition and automatically re-establish the connection? Typically the server will be reboot at night so I'd like the first person in the morning to have this code catch the problem and fix things, otherwise it stays broken until I restart apache. :-) Thanks, Dave # # # The information contained in this message, including any accompanying documents, is confidential and is intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the originator immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. For additional information about GTE TSI, please visit our website at http://www.tsi.gte.com. -- Florian Clever fc@clever-soft.com http://www.Clever-Software-Solutions.de/ PGP Key @ ldap://certserver.pgp.net/ "C combines all the power of assembly language with all the ease of use of assembly language" -- trad

« previous php.db (#3708) next »