2 Check oci_new_connect try/catch end-of-scope with old_oci_close_semantics Off
4 <?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
6 oci8.old_oci_close_semantics=0
10 require(dirname(__FILE__).'/details.inc');
15 "drop table scope_try3_tab",
16 "create table scope_try3_tab (c1 number)"
20 $c1 = oci_new_connect($user,$password,$dbase);
22 $c1 = oci_new_connect($user,$password);
24 oci8_test_sql_execute($c1, $stmtarray);
30 // Make errors throw exceptions
32 set_error_handler(create_function('$x, $y', 'throw new Exception($y, $x);'));
37 $c = oci_new_connect($user,$password,$dbase);
39 $c = oci_new_connect($user,$password);
40 $s = oci_parse($c, "insert into scope_try3_tab values (1)");
41 oci_execute($s, OCI_DEFAULT); // no commit
42 $s = oci_parse($c, "insert into scope_try3_tab values (ABC)"); // syntax error -> throws exception
43 oci_execute($s, OCI_DEFAULT); // no commit
47 echo "Caught Exception: ". $e->getMessage(), "\n";
50 // Verify data is not yet committed
51 $s1 = oci_parse($c1, "select * from scope_try3_tab");
53 oci_fetch_all($s1, $r);
60 // Verify data was committed in the Catch block
62 $s1 = oci_parse($c1, "select * from scope_try3_tab");
64 oci_fetch_all($s1, $r);
70 "drop table scope_try3_tab"
73 oci8_test_sql_execute($c1, $stmtarray);
80 Caught Exception: oci_execute(): ORA-%r(00984|57000: TT2957)%r: %s
81 resource(%d) of type (oci8 connection)