On Wed, Jan 26, 2011 at 12:27 PM, John Scoles <sco...@pythian.com> wrote: >> Or, is there some way to verify the OCI environment and reset it when >> it is found to be unusable - in other words, trap the >> "OCIHandleAlloc(OCI_HTYPE_ERROR)" error and reconnect? >> > > Well normally an environment will not die unless you loose connectivity. If > you have lost connectivity then there would not be much point in trying to > reconnect automatically your network or DB is Down??
Databases go down sometimes. There could be a power failure or hardware crash, or maybe the DB is just being bounced by the DBAs after making a configuration change or upgrade. The problem is even if the database comes back up, it still keeps generating the same error. Why should I also have to manually restart the Apache server just because the database has come back online? dbi->connect() should just start working once the DB is back online. Once that error occurs once, how about deleting the OCI environment so that the next ->connect after that will succeed?