[Editor's note: OCI8 1.3 should not experience the problem described in this user comment. The first use of such a connection will return an Oracle error which will trigger a cleanup in PHP. Subsequent persistent connection calls will then succeed. For high availability you might consider doing consecutive oci_pconnect calls in your script.]
If you connect using oci_pconnect and the connection has logged you off but is still valid, there seems to be no way to re-use that connection. The next time I try oci_pconnect and then perform an oci_execute operation, I get a "ORA-01012: not logged on" warning. This problem remains, even if I close the connection using oci_close. I ended up with the following (rather annoying) code.
{
if (!function_exists('oci_pconnect'))
returnfalse;$toReturn=oci_pconnect('user','pass','db');
if ($testRes= @oci_parse($toReturn,'SELECT Count(group_type_code) FROM pvo.group_type'))
if (@oci_execute($testRes))
if (@oci_fetch_array($testRes))
return$toReturn;oci_close($toReturn);
if (!function_exists('oci_connect'))
returnfalse;$toReturn=oci_connect('user','pass','db');
if ($testRes= @oci_parse($toReturn,'SELECT Count(group_type_code) FROM pvo.group_type'))
if (@oci_execute($testRes))
if (@oci_fetch_array($testRes))
return$toReturn;oci_close($toReturn);
if (!function_exists('oci_new_connect'))
returnfalse;$toReturn=oci_new_connect('user','pass','db');
if ($testRes= @oci_parse($toReturn,'SELECT Count(group_type_code) FROM pvo.group_type'))
if (@oci_execute($testRes))
if (@oci_fetch_array($testRes))
return$toReturn;oci_close($toReturn);
returnfalse;
}?>