|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-24 09:40 UTC] fernandopapa at gmail dot com
[2007-04-24 09:53 UTC] tony2001 at phpclub dot net
[2007-04-24 10:34 UTC] fernandopapa at gmail dot com
[2007-04-24 10:43 UTC] tony2001 at phpclub dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 07:00:02 2025 UTC |
Description: ------------ We have two instalations. The first one, had php 4.4.3 with the standar oci8 support (the oci8 than comes with 4.3.3). The second, had php 4.4.3 with the latest pecl oci8 package (1.2.3). This because in this installation we need to use oracle instanclient. The compilation was standalone php (only for scripting purposes, no integration with apache) We need to run a php script who open a oracle connection inside a php-function (the ocilogon is inside the function). These php-function was called several times (in the test is inside a loop, 10 times). When php established the connection, execute a package. In this package, we have a session variable (mantain the value until session is closed). The test case only sum 1 to the last value of the variable. In the first installation, the session variable mantain the value until php finish, we print the value of the variable and see 1,2,3,4...10. In the second installation, the session variable doesn't maintain the value, we print the value of the variable and see 1,1,1,1...1. I need to know what is the "bad behavior", or what is the problem. I test one more thing. In the second installation, I made an ocilogon before the loop. And I get the same result of the first installation. So, I made a workaround, but I want to know what is the problem, if this is a bug, a feature or an incorrect use. Reproduce code: --------------- <?php function testdb($i) { $con = ocilogon("scott","tiger","test"); echo $i . $con . " -> "; $curs = ocinewcursor($con); $query = " begin PACK_TRANSFER_V4_NO_TRANSFERIB.PR_PRUEBA_SESSION( :data ); end;"; $stat = ociparse($con,$query); ocibindbyname($stat,"data",$curs,-1,OCI_B_CURSOR); ociexecute($stat); ociexecute($curs); ocifetch($curs); $valor = ociresult($curs,"CONTADOR") ; echo "Valor del CONTADOR: " . $valor . "\n"; } print "INICIO\n"; for($i=0;$i<10;$i++) testdb($i); print "FIN<BR>\n"; ?> Expected result: ---------------- # /usr/local/bin/php test_connection_logon.php INICIO 0Resource id #4 -> Valor del CONTADOR: 1 1Resource id #7 -> Valor del CONTADOR: 1 2Resource id #10 -> Valor del CONTADOR: 1 3Resource id #13 -> Valor del CONTADOR: 1 4Resource id #16 -> Valor del CONTADOR: 1 5Resource id #19 -> Valor del CONTADOR: 1 6Resource id #22 -> Valor del CONTADOR: 1 7Resource id #25 -> Valor del CONTADOR: 1 8Resource id #28 -> Valor del CONTADOR: 1 9Resource id #31 -> Valor del CONTADOR: 1 FIN<BR> Actual result: -------------- # /usr/local/bin/php test_connection_logon.php INICIO 0Resource id #4 -> Valor del CONTADOR: 1 1Resource id #7 -> Valor del CONTADOR: 2 2Resource id #10 -> Valor del CONTADOR: 3 3Resource id #13 -> Valor del CONTADOR: 4 4Resource id #16 -> Valor del CONTADOR: 5 5Resource id #19 -> Valor del CONTADOR: 6 6Resource id #22 -> Valor del CONTADOR: 7 7Resource id #25 -> Valor del CONTADOR: 8 8Resource id #28 -> Valor del CONTADOR: 9 9Resource id #31 -> Valor del CONTADOR: 10 FIN<BR>