Hi,
While writing an app that regularly checks an oracle database for new
entries I run into problems when the database server suddenly goes
offline (the network connection can't be trusted).
The call right after such a connection loss just hangs the application.
Here is a little example to illustrate ...
<?
ob_implicit_flush();
$cnn = OCILogon( 'scot', 'tiger' );
function valid_cnn( &$cnn ) {
return ( trim( OCIServerVersion($cnn) ) != '' );
}
while( true ) {
print valid_cnn( $cnn ) ? "OK\n" : "DOWN\n";
sleep(1);
}
?>
Running it results in a nice collection of "OK"'s and a hangup when I
disconnect the network. Plugging the network back in resumes the series
of "OK"'s after a while ... But the desired behaviour ( "DOWN" ) won't
appear.
Did anyone of you encountered a similar situation ? How did you solve
this ? ... Any ideas are good, since I'm a bit stuck and any lead might
help to a probably very simple solution (that I just can see rigth now)
Thanks in advance,
Christophe VG
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]