Re: transaction login in pgsql not working

From: Date: Tue, 13 Mar 2001 22:27:09 +0000
Subject: Re: transaction login in pgsql not working
References: 1  Groups: php.pear 
Request: Send a blank email to php-pear+get-1821@lists.php.net to get a copy of this message
[Burak DAYIOGLU <dayioglu@metu.edu.tr>] > 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 <ssb@fast.no> Fast Search & Transfer ASA, Trondheim, Norway

« previous php.pear (#1821) next »