ID: 40313
Updated by: [EMAIL PROTECTED]
Reported By: christopher dot jones at oracle dot com
-Status: Assigned
+Status: Suspended
Bug Type: OCI8 related
Operating System: n/a
PHP Version: 5.2.1RC4
Assigned To: tony2001
New Comment:
I think the current behavior is correct and I personally do not see any
reasons to change it at the moment.
Previous Comments:
------------------------------------------------------------------------
[2007-02-02 02:29:03] christopher dot jones at oracle dot com
Description:
------------
The session management differs in some cases when there is an
uncommited transaction.
Run the test case with and without the parse/execute lines commented.
When the lines are commented out an explicit oci_close() or the end of
f1() causes the connection to be closed. With the lines active the
sessions remain open and the transactions are not rolled back.
A third error case is if the sample script is changed to use
oci_new_connect(). Confusingly the explict close has no effect but the
end-of-scope will rollback and close the connection.
This may be a in implementation quirk of reference counting but it is a
user level bug. Oci_close() should always close when
oci8.oci_old_close_semantics has its default value. The cleanup at
end-of-scope should be consistent regardless of the user transaction
state.
Reproduce code:
---------------
<?php
// Create this table first: create table cj1 (a number);
$v = ini_get('oci8.old_oci_close_semantics');
echo "oci8.old_oci_close_semantics is $v\n";
ociinternaldebug(1);
echo "Test 1\n";
$c1 = oci_new_connect("hr", "hr", "localhost/XE");
echo "Do statement\n";
$s1 = oci_parse($c1, "insert into cj1 values(1)");
var_dump(oci_execute($s1, OCI_DEFAULT));
echo "Before close: transaction should rollback and connection should
be closed\n";
ocilogoff($c1);
echo "After close\n";
echo "Test 2\n";
function f1()
{
echo "In f1()\n";
$c2 = oci_new_connect("hr", "hr", "localhost/XE");
if (!$c2) {
$m = ocierror();
echo $m['message'];
exit;
}
else {
echo "Connection succeeded\n";
}
echo "Do statement\n";
$s2 = oci_parse($c2, "insert into cj1 values(1)");
var_dump(oci_execute($s2, OCI_DEFAULT));
echo "Before end of scope\n";
}
f1();
echo "after f1() call - end of scope\n";
echo "End of script\n";
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40313&edit=1