Re: psycopg problem

From: Gandalf (gandalf_at_geochemsource.com)
Date: 03/11/04


Date: Thu, 11 Mar 2004 09:56:12 +0100
To: "comp.lang.python" <python-list@python.org>

Oh my god! I tried the same with other modules too.

Here are the resulsts:

1. psycopg: when a command fails, it will terminate the trasaction
but it tells that it will ignore other commands until the end of the
transaction block
2. PyGreSQL: when a command fails, it will terminate the trasaction but
it tells that it will ignore other commands until the end of the
transaction block
3. pyPgSQL: when a command fails, it will terminate the trasaction
without furhter notice (!!!)

I see big problems here. I tried these too: Oracle, FireBird, MS SQL,
SAP DB. I was able to run an erroneous SQL and then continue my transaction
(e.g. execute other commands in the same transaction). In my situation,
I just can't tell if a command will fail or not. If would be too hard
and too slow
to determine if a command will fail or not. Hey, this is why exceptions
was born! From the other side, I must be able to commit or rollback all
my changes
at the end of the block, depending on several things. Can anybody help
me please?

Gandalf wrote:

>
> Hi All!
>
> Every time I get an error psycopg refuses to execute further commands
> in the same transaction:
>
> psycopg.ProgrammingError:ERROR: current transaction is aborted,
> commands ignored until end of transaction block
>
> Why is that? I would like to decide if I want to continue my
> transaction or not. Isn't it possible?
>
> Best,
>
> G
>
>



Relevant Pages