From: Oliver Jowett <oliver@opencloud.com>
To: Vadim Nasardinov <vadimn@redhat.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC CTS 1.2.1
Date: Wed, 17 Nov 2004 12:47:21 +1300
Message-ID: <419A9189.3060301@opencloud.com> (raw)
In-Reply-To: <200411161742.52424@vadim.nasardinov>
References: <200410221627.20176@vadim.nasardinov>
<200410271415.39796@vadim.nasardinov>
<41802737.2030203@opencloud.com>
<200411161742.52424@vadim.nasardinov>
Vadim Nasardinov wrote:
> The crucial difference between these two vehicles is this. In the ejb
> vehicle, each transaction is explicitly demarcated with "BEGIN
> ... COMMIT". When the first DROP TABLE statement fails, it causes the
> backend to ignore any subsequent statements issued in the same
> transaction. (As a parenthetical aside, other databases don't behave
> this way. I believe this has been discussed countless times.)
It sounds like a bug in the CTS if it assumes it can run DDL (or for
that matter any query) in a transaction after a failure. This is not
specified by JDBC, AFAIK, and is demonstrably not a valid assumption to
make under PostgreSQL.
Is there any way to tell the CTS to run each bit of DDL in a separate
transaction?
If you can issue a SAVEPOINT before the DROP TABLE and ROLLBACK TO
SAVEPOINT on failure, it might work. But it seems unlikely you can do
this without modifying the CTS itself, and you'd need to use 8.0 for
SAVEPOINT support.
It might be useful to have an option to make the driver automatically
generate SAVEPOINTs before each query (when autocommit is off), and do
ROLLBACK TO SAVEPOINT or RELEASE SAVEPOINT as appropriate after the
query completes. This gives behaviour more like other DBs at some cost
to performance (I wouldn't want it to be on by default). Again, this
would only work against an 8.0 server.
-O
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: oliver@opencloud.com, vadimn@redhat.com
Subject: Re: JDBC CTS 1.2.1
In-Reply-To: <419A9189.3060301@opencloud.com>
References: <200410221627.20176@vadim.nasardinov> <200410271415.39796@vadim.nasardinov> <41802737.2030203@opencloud.com> <200411161742.52424@vadim.nasardinov> <419A9189.3060301@opencloud.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox