Re: [PHP-DB] Losing the ability to connect to Oracle database
Hi Leo, We are having the same problem. Check out the bug I filed many months ago http://bugs.php.net/bug.php?id=30808 I can't for the life of me figure out why the bug is suspended, as this seems to be a common issue with Oracle and php5. Perhaps you should also and your comments to the bug report. To resolve the issue, we do an apache restart every time the db goes down. This flushes whatever connections php pools to Oracle (sounds weird considering we are doing oci8nlogon). I really hope that the OCI8 library gets some serious attention soon. In my mind this is a show stopper, and it appears that there are a few other big ones lying around... Michael -Original Message- From: Leo D. Geoffrion [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 8:27 AM To: php-db@lists.php.net Subject: [PHP-DB] Losing the ability to connect to Oracle database I recently upgraded to PHP5 and now have a curious Oracle problem. The PHP scripts query the database fine. Then overnight, the database shuts down for backup and restarts. The next day, PHP can no longer connect to the database until I restart Apache. Then, it's happy until Oracle restarts the next night. We did not encounter this problem with PHP4. I've tried adjusting the php command from the old ocilogon() to oci_connect() but the problem continues. Incidentally, I am using a simple connection, not a persistent one. Can someone advise what's wrong here or how to get PHP/Apache to survive a database restart. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php CONFIDENTIALITY NOTICE This message contains confidential information intended only for the use of the individual or entity named as recipient. Any dissemination, distribution or copying of this communication by anyone other than the intended recipient is strictly prohibited. If you have received this message in error, please immediately notify us and delete your copy. Thank you. AVIS DE CONFIDENTIALITÉ Les informations contenues aux présentes sont de nature privilégiée et confidentielle. Elles ne peuvent être utilisées que par la personne ou l'entité dont le nom paraît comme destinataire. Si le lecteur du présent message n'est pas le destinataire prévu, il est par les présentes prié de noter qu'il est strictement interdit de divulguer, de distribuer ou de copier ce message. Si ce message vous a été transmis par mégarde, veuillez nous en aviser immédiatement et supprimer votre copie. Merci. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Losing the ability to connect to Oracle database
Leo, Please let me know how that works for you. I don't remember the specifics (if we where testing using plogon, nlogon or just logon), but we did try and implement that fix and it didn't work for us. Thanks, Michael -Original Message- From: Leo D. Geoffrion [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 6:03 AM To: Michael Caplan Subject: Re: [PHP-DB] Losing the ability to connect to Oracle database Yes, I just found 30808. It's suspended because the fix is stated in the discussion (uncomment out a small section of oci8.c), but for performance reasons they don't want to make this part of the standard code. I've rebuilt php5 now with the change in place and will see if this fixes the problem for my systems. I can confirm that it's at least harmless. Michael Caplan wrote: Hi Leo, We are having the same problem. Check out the bug I filed many months ago http://bugs.php.net/bug.php?id=30808 I can't for the life of me figure out why the bug is suspended, as this seems to be a common issue with Oracle and php5. Perhaps you should also and your comments to the bug report. To resolve the issue, we do an apache restart every time the db goes down. This flushes whatever connections php pools to Oracle (sounds weird considering we are doing oci8nlogon). I really hope that the OCI8 library gets some serious attention soon. In my mind this is a show stopper, and it appears that there are a few other big ones lying around... Michael -Original Message- From: Leo D. Geoffrion [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 8:27 AM To: php-db@lists.php.net Subject: [PHP-DB] Losing the ability to connect to Oracle database I recently upgraded to PHP5 and now have a curious Oracle problem. The PHP scripts query the database fine. Then overnight, the database shuts down for backup and restarts. The next day, PHP can no longer connect to the database until I restart Apache. Then, it's happy until Oracle restarts the next night. We did not encounter this problem with PHP4. I've tried adjusting the php command from the old ocilogon() to oci_connect() but the problem continues. Incidentally, I am using a simple connection, not a persistent one. Can someone advise what's wrong here or how to get PHP/Apache to survive a database restart. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Leo D. Geoffrion, Ph.D. EMAIL: [EMAIL PROTECTED] Skidmore College Retiree PHONE: 518 580-0555 Currently: Senior Systems Administrator SGS Testcom Inc. 2911 Route 9 Ballston Spa, NY 12020 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= CONFIDENTIALITY NOTICE This message contains confidential information intended only for the use of the individual or entity named as recipient. Any dissemination, distribution or copying of this communication by anyone other than the intended recipient is strictly prohibited. If you have received this message in error, please immediately notify us and delete your copy. Thank you. AVIS DE CONFIDENTIALITÉ Les informations contenues aux présentes sont de nature privilégiée et confidentielle. Elles ne peuvent être utilisées que par la personne ou l'entité dont le nom paraît comme destinataire. Si le lecteur du présent message n'est pas le destinataire prévu, il est par les présentes prié de noter qu'il est strictement interdit de divulguer, de distribuer ou de copier ce message. Si ce message vous a été transmis par mégarde, veuillez nous en aviser immédiatement et supprimer votre copie. Merci. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: oci8 cannot connect after restarting DB
Hi John, Just saw your blog today on Andi's PHP5 / Oracle article. One of the two bugs you sited in your previous email was one that I opened (http://bugs.php.net/bug.php?id=30808) I'm not sure what the case is with the 4.3.x line, but my hunch this issue is 'bigger' than PHP5. More troubling is tony2001 response to my bug report (we don't want to turn on the noted fix, but will implement something workable with PDO). I'm anxious to hear his reply to my follow-up: it makes no sense to me that oracle users will have to settle for broken logon functions (with the fix sitting commented in the current code) or abandond the oci8 library all together for PDO when it hits the streets (which will be some time). Best, Michael -Original Message- From: John Lim [mailto:[EMAIL PROTECTED] Sent: Thursday, November 18, 2004 3:42 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: oci8 cannot connect after restarting DB Michael, After rereading your post again, i realise you mentioned it's happening with non-persistent connections also. That puzzles me. Perhaps we are talking about multiple bugs here. In general, I have not found PHP5 and oci8 to be very stable, and would not recommend moving anything production to use PHP5 just yet. Regardsd, John John Lim [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi This is because you are using persistent connections, which are left dangling and do not restart after the database restarts. Apparently you can hack your tnsnames.ora or oci8 extension. See http://bugs.php.net/bug.php?id=15390 and http://bugs.php.net/bug.php?id=30808 Regards, John Michael Caplan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Every evening, for whatever reason, our Oracle db (9.2.0) is restated. After it is restarted, I am unable to build a connection with Oracle from PHP untill Apache is restarted. Whenever I do an ociplogon() or ocilogon() following an Oracle DB restart, it fails but I am unable to get a description of the error. Restarting Apache fixes the problem. Has anyone else experianced the same issue? It appears to me that this is a php oci8 bug. (shouldn't a new connection be built if a persistant connection fails, and if not using persistant connections, shouldn't this be a non issue?) Thanks, Michael -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] multiple returned lob resource being overwritten in oci8
Hi, I am selecting multiple columns from a table, one being a clob. the query returns multiple records for the query. The results are all good, except the clob column. The last returned record's clob column overwrites all previous clob columns (all the previous records have there unique data, except the clob columns which contains the data for the last record across all previous records), depending on how I fetch the data. A working example: $query = 'select id, author, cdate, views, title, message, top from APP_THREADS where TYPE = \'D\''; $stmt = ociparse($fw_db-connection, $query); ociexecute($stmt); while (OCIFetchInto ($stmt, $row, OCI_ASSOC)) { echo $row['MESSAGE']-load(); } with the output being something like this: clob1 clob2 clob3 clob4 All good. But, if I don't grap the lob output right away, and do some other assignement work on the result before hand, the above explained issue takes shape. The issue, after some testing, appears to be how the oci8 function stores the clob resource. The following code results in this problem: $query = 'select id, author, cdate, views, title, message, top from APP_THREADS where TYPE = \'D\''; $stmt = ociparse($fw_db-connection, $query); ociexecute($stmt); while (OCIFetchInto ($stmt, $row, OCI_ASSOC)) { $messages[] = $row['MESSAGE']; } foreach ($messages as $message) { var_dump($message-load()); } with the output being: clob4 clob4 clob4 clob4 In this example the lob resources are overwritten when you loop through the result set the first time around, resulting in all fetched lobs returning the value of the last lob in the result set. The question is: is this an oci8 bug or just how things have to be done? Thanks, Michael