Re: [PHP-PEAR] transaction login in pgsql not working
[email protected] ((Stig Sæther Bakken)) 13 Mar 2001 23:27:09 +0100
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
[Burak DAYIOGLU <[email protected]>] > Although looking to be correctly implemented in simplequery(), commit() > and rollback(), tranaction login in pgsql.php is not working. The below > is a small demostrative code just written to test transaction logic: > > $database=DB::factory("pgsql"); > $dsn=array(phptype=>"pgsql",hostspec=>"localhost",database=>"kek"); > $database->connect($dsn); > $database->autocommit(FALSE); > var_dump($database); echo "<HR>"; > $handle=$database->simplequery("insert into names values (1,'burak')"); > var_dump($database); echo "<HR>"; > $handle=$database->simplequery("insert into cities values > (2,'ankara')"); > $database->rollback(); > var_dump($database); echo "<HR>"; > > When run, on my linux box, it gives the following output. Please note > the > transaction_opcount's: > object(db_pgsql)(18) { ["prepare_tokens"]=> array(0) { } > ["prepare_types"]=>array(0) { } ["transaction_opcount"]=> int(0) > ........ > --------------------------------------------------------------------- > object(db_pgsql)(18) { ["prepare_tokens"]=> array(0) { } > ["prepare_types"]=> array(0) { } ["transaction_opcount"]=> int(0) > ....... > --------------------------------------------------------------------- > object(db_pgsql)(18) { ["prepare_tokens"]=> array(0) { } > ["prepare_types"]=> array(0) { } ["transaction_opcount"]=> int(0) > ...... > --------------------------------------------------------------------- > > When the sql statements are given over the psql interface they do work > seamless. I am investigating the problem further, however any help from > more experienced PEAR ppl is gladly accepted. :) Hmm, which version are you using? Could you try running the pgsql tests on your machine? You need the CGI version of PHP installed on your system to do so, as well as a postgres database called "test". Then run "make test TESTS=pear/DB/tests/pgsql"... - Stig -- Stig Sæther Bakken <[email protected]> Fast Search & Transfer ASA, Trondheim, Norway