Lists: | pgsql-jdbc |
---|
From: | "Antony Paul" <antonypaul24(at)hotmail(dot)com> |
---|---|
To: | "pgsql-jdbc" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | AutoCommit and SQLException |
Date: | 2004-08-30 10:56:23 |
Message-ID: | BAY15-DAV15d2DpZtYo00029474@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Hi all,
What happens to transaction when an SQL exception is thrown while it is
in a transaction. Does the connection automatically rollbacks the
transactions or we have to roll back it ?. I am using PreparedStatements and
Statements and no stored procedures.
Is there any specification for the behaviour of connection pools ?.
rgds
Antony Paul
From: | Oliver Jowett <oliver(at)opencloud(dot)com> |
---|---|
To: | Antony Paul <antonypaul24(at)hotmail(dot)com> |
Cc: | pgsql-jdbc <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: AutoCommit and SQLException |
Date: | 2004-08-30 11:31:42 |
Message-ID: | 4133101E.1090401@opencloud.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-jdbc |
Antony Paul wrote:
> Hi all,
> What happens to transaction when an SQL exception is thrown while it is
> in a transaction. Does the connection automatically rollbacks the
> transactions or we have to roll back it ?
You have to roll it back yourself.
PostgreSQL will generate errors on subsequent queries in a transaction
after an error (until you roll it back), but that's not necessarily true
of other DBs.
-O