#22857 [Opn->Fbk]: OCIExecute Hangs
| From: | sniper@php.net | Date: | Tue, 25 Mar 2003 00:03:55 +0000 |
| Subject: | #22857 [Opn->Fbk]: OCIExecute Hangs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-36343@lists.php.net to get a copy of this message | ||
ID: 22857
Updated by: sniper@php.net
Reported By: dean at vipersoft dot co dot uk
-Status: Open
+Status: Feedback
Bug Type: OCI8 related
Operating System: Linux 2.4
PHP Version: 4.3.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
First of all, those putenv()'s are useless, you need to set
them in the environment before starting Apache / running CLI.
It might help if you tried debugging this with gdb.
# gdb /opt/php/bin/php
(gdb) run yourtest.php
And do that as many times as required to get it fail..
Previous Comments:
------------------------------------------------------------------------
[2003-03-24 14:06:01] dean at vipersoft dot co dot uk
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 this bug report at http://bugs.php.net/?id=22857&edit=1