From: dean at vipersoft dot co dot uk
Operating system: Linux 2.4
PHP version: 4.3.1
PHP Bug Type: OCI8 related
Bug description: OCIExecute Hangs
Using the sample code below to submit a number of queries to an Oracle
database - about every 1 in 10 executions causes the OCIExecute function
to simple "hang" for about 10 minutes before timing out.
If more information is needed or any sorts of debugging is required, I
will follow up to this bug with the requested information.
Thanks
Dean
#!/opt/php/bin/php -q
<?
$webDbase = "blah";
$webUser = "blah";
$webPassword = "blah";
global $ORACLE_HOME;
$ORACLE_HOME = "/opt/oracle/OraHome81";
PutEnv("ORACLE_SID=".$webDbase);
PutEnv("LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:$ORACLE_HOME/jdbc/lib");
PutEnv("ORACLE_HOME=".$ORACLE_HOME);
$conn = ocilogon($webUser, $webPassword, $webDbase) or die ("Could not
connect (Bad background connect Userid or Password)
[".Getenv("ORACLE_SID")."]");
// Loop around 4000 times - basically to throw a lot
// of queries at the database
for ($i=1;$i<=4000;$i++)
{
echo "Iteration ".$i."\n";
// use a random number to use differing queries
$strSQL = "SELECT *
FROM blah
WHERE id = '".rand(0,50000)."'";
$qid = OCIparse($conn, $strSQL);
echo "before execute\n";
OCIexecute($qid);
echo "after execute\n";
}
echo "Done";
?>
sample output from above when "hung"
.
.
.
Iteration 2671
before execute
after execute
Iteration 2672
before execute
after execute
Iteration 2673
before execute
<then nothing>
Notes:
* Doesn't happen every time
* Happens about 1 in every 10 runs of the above code
* Happens from both the CLI php and through Apache
* Eventually times out without finishing off its iteration
--
Edit bug report at http://bugs.php.net/?id=22857&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=22857&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=22857&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=22857&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=22857&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=22857&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=22857&r=support
Expected behavior: http://bugs.php.net/fix.php?id=22857&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=22857&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=22857&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=22857&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22857&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=22857&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=22857&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=22857&r=gnused