Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

The process is killed after OCIFetch()

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

The process is killed after OCIFetch()

Postby strmdn » Tue Jan 21, 2003 9:01 am

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
strmdn
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jan 21, 2003 8:05 am

Postby Joan Garnet » Tue Jan 21, 2003 2:01 pm

I don't use Oracle...
but where is the problem exactly?
I guess it works more or less in the same way as Mysql queries.
:)
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars

The process is killed after OCIFetch()

Postby strmdn » Wed Jan 22, 2003 1:54 am

I have tried without @ but the visualization of any errors is not had, the process falls without leaving anybody trace.
The following version of the script is more complete:

<?php

set_time_limit(0);

ini_set('display_errors','0');
ini_set('log_errors','1');
//START

$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))
{

echo("In while ...\n");
....
....

}

OCIFreeStatement($stmt);
sleep(2);

}while ($error==0);

OCILogoff($dbConnection);

?>

If after three or more hours that the SELECT not return data then when SELECT return data and enter in while loop, the last instruction that is executed it is the "echo".

Thank for any suggestion
strmdn
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jan 21, 2003 8:05 am

The process is killed after OCIFetch()

Postby strmdn » Wed Jan 22, 2003 6:12 am

The error has been found, the function OCIFetch() is not responsible.

Thank you.
strmdn
New php-forum User
New php-forum User
 
Posts: 5
Joined: Tue Jan 21, 2003 8:05 am


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.