Re: transactions from PHP - double COMMIT required?

From: mikie <mikie(dot)pl(at)gmail(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: transactions from PHP - double COMMIT required?
Date: 2007-03-05 15:16:56
Message-ID: ca35ce500703050716y13ed79cdp2e1519c7bfa2828b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

2007/3/5, Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>:
> mikie wrote:
> > 2007/3/2, Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>:
> >> mikie wrote:
> >> > 2007/3/1, Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>:
> >> >> Yeah, do the above recommendation to see if all of your statements are
> >> >> making
> >> >> thier way into pg
> >> >
> >> > OK, I have checked the logs. I can see both COMMIT statements in the
> >> > log - the first commit from my transaction and then the other that I
> >> > send to workaround the problem.
> >>
> >> There must be some other problem. Do you have trasaction ID on the logs?
> >> See if both commits go in the same transaction.
> >
> > Could you please advise me how to check the transaction ID in the log?
>
> Edit postgresql.conf:
>
> log_line_prefix = '<%t %x>'
>
> And restart postmaster.

Thanks, it works. I can see the transaction IDs -- I described my
solution in my previous post.

> >> Any errors during the transaction?
> >
> > As I wrote in my first post, I make this error intentionally to check
> > if transaction works (if something fails, then the entire transaction
> > should be rolled back). I intentionally give wrong data in the "date"
> > field for example.
> > Perhaps I should ask again: is it my responsibility to check if the
> > transaction failed and issue a ROLLBACK command, or will the PG server
> > do it automatically?
>
> One question: Why dont you but each query in a diferent pg_exec() command?

It does not make any difference if I put single query in each
pg_query() command.

--

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Thomas Woerly 2007-03-07 09:36:06 Undefined function pg_escape_bytea() despite good PG version
Previous Message mikie 2007-03-05 15:14:59 Re: transactions from PHP - double COMMIT required?