Please find included in this PR a patch that implements the apr_dbd_check_conn() function for the apr_dbd_oracle.c driver. So far as I know (I could be wrong!) there isn't a simple OCI function to check for connection health; instead I implemented something similar to what seems to be recommended for use in the JNDI validationQuery field in Tomcat and other similar applications. Thanks to my colleague Jeff Gelb for this pointing out.
Created attachment 20218 [details] check_conn for apr_dbd_oracle.c Should apply to APR-util HEAD as of 18/05/2007.
Thanks for the patch Chris. I'm guessing "SELECT 1 FROM dual" is some kind of Oracle-ism for "am I connected?", right? I'm also guessing this should return precisely one row.
The "dual" pseudo-table is kind of a scratch table in Oracle which you can use in statement where you just need a placeholder, e.g., "SELECT SYSDATE FROM dual" to get the current date, etc. So this statement should always return one row, as you say. (The user doesn't need to have created a "dual" table; it's always available for use in statements.)
Fixed in r540761. Thanks for the patch Chris!