2 Test oci_pconnect end-of-scope when statement returned
4 <?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
8 require(dirname(__FILE__).'/details.inc');
13 "drop table connect_scope2_tab",
14 "create table connect_scope2_tab (c1 number)",
18 $c1 = oci_new_connect($user,$password,$dbase);
20 $c1 = oci_new_connect($user,$password);
22 oci8_test_sql_execute($c1, $stmtarray);
26 echo "Test 1 - oci_pconnect\n";
30 global $user, $password, $dbase;
33 $c = oci_pconnect($user,$password,$dbase);
35 $c = oci_pconnect($user,$password);
36 $s = oci_parse($c, "insert into connect_scope2_tab values (1)");
37 oci_execute($s, OCI_DEFAULT); // no commit
38 return($s); // this keeps the connection refcount positive so the connection isn't closed
43 // Check nothing committed yet
45 $s1 = oci_parse($c1, "select * from connect_scope2_tab");
46 oci_execute($s1, OCI_DEFAULT);
47 oci_fetch_all($s1, $r);
50 // insert 2nd row on returned statement, committing both rows
53 // Verify data was committed
55 $s1 = oci_parse($c1, "select * from connect_scope2_tab");
57 oci_fetch_all($s1, $r);
63 "drop table connect_scope2_tab"
66 oci8_test_sql_execute($c1, $stmtarray);