The process is killed after OCIFetch()

A

Anonymous

Guest
Hello,

we have a PHP script that run in a infinite loop looking
on ORACLE DB (8.1.7). In each loop a SELECT is done, if this doesn't
return data then the SELECT is executed after two seconds. If after not
certain time the SELECT doesn't return data then when it returns data
the process is killed after OCIFetch(), view code for understand
better.

//START

//Set max execution time to infinite

set_time_limit(0);

$dbConnection = @OCILogon(USER_ID, PASSWORD, SID);
// infinite loop
$error=0;
do
{
$query="SELECT DATA FROM PROV";
$stmt = @OCIParse($dbConnection,$query);
@OCIDefineByName($stmt,"DATA",&$data);
@OCIExecute($stmt);
$err_ora = @OCIError($stmt);
if ($err_ora)
{
$error=1;

}

While (@OCIFetch($stmt) && ($error==0))
{
....
....

}
@OCIFreeStatement($stmt);
sleep(2);

}while ($error==0);

Thanks for any suggestion
 
The error has been found, the function OCIFetch() is not responsible
but the function echo in the cycle while it causes an error from the
moment that after the run of the
script the shell is closed.

Thank you and sorry for all.

:lol:
 
Have you tried with a persistent connection?
OCIPLogon --> Connect to an Oracle database using a persistent connection
 
Back
Top