pyPgSql there is already a transaction in progres

Paul Boddie paul at boddie.org.uk
Tue Jun 2 13:38:09 EDT 2009


On 2 Jun, 16:49, Tep <petshm... at googlemail.com> wrote:
> On Jun 2, 3:58 pm, Paul Boddie <p... at boddie.org.uk> wrote:
> > Really, you should use the commit method on the cursor object
>
> You mean connection object, do you?

Yes, I meant the connection object. :-)

> I've tried that, but forgotten to remove BEGIN;COMMIT; statements from
> my queries
> Now, I do commit on connection object after _each_ query and it seems
> to work :)

You should probably use rollback in order to close transactions just
in case you've issued a statement which changes the database. Think of
it as kind of a synchronisation operation.

[...]

> In that way it works too, which means, everything is clear now

Great!

Paul



More information about the Python-list mailing list