Re: transactions from PHP - double COMMIT required? - Mailing list pgsql-php

From mikie
Subject Re: transactions from PHP - double COMMIT required?
Date
Msg-id ca35ce500703010329j329b8a5h6ee8958ddb6711e0@mail.gmail.com
Whole thread Raw
In response to Re: transactions from PHP - double COMMIT required?  (Mihail Mihailov <Mihail.Mihailov@uta.fi>)
Responses Re: transactions from PHP - double COMMIT required?
Re: transactions from PHP - double COMMIT required?
List pgsql-php


2007/3/1, Mihail Mihailov <Mihail.Mihailov@uta.fi>:
Hi,

I think you should use ROLLBACK if the query cannot be executed.
one can commit only results of the queries that work.
Try ROLLBACK statement.

The thing is that when I try my transaction from psql console then the command ROLLBACK is being issued by the postgres server itself right after I close my transaction with COMMIT;. According to transaction logic and idea - if something goes wrong then the entire transaction is being cancelled by ROLLBACK - it is the server responsibility to rollback such transaction.

Now, when I try to do some inserts within my transaction I don't know if they will fail or not. Eitherway I am closing my transaction with the COMMIT; command - is that correct way ?
It works logically OK from within psql console (I start with BEGIN and then close my sql commands with commit) but it does not work this way from within PHP script. I believe there is some issue with PHP - I am not sure if PHP processor applies some changes to my query and thus ignores the commit command?

--
Mike

pgsql-php by date:

Previous
From: Mihail Mihailov
Date:
Subject: Re: transactions from PHP - double COMMIT required?
Next
From: "David Legault"
Date:
Subject: Re: transactions from PHP - double COMMIT required?