From: Quartz <quartz12h@yahoo.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC gripe list
Date: Wed, 30 Mar 2011 07:04:50 -0700 (PDT)
Message-ID: <121151.6377.qm@web33207.mail.mud.yahoo.com> (raw)
In-Reply-To: <4D920984020000250003BF08@gw.wicourts.gov>
> > it would be done in a transaction otherwise what is
> the point ?
>
> That's a fair question. A batch will almost always
> run faster if
> done as a single transaction which either runs in its
> entirety or
> fails in its entirety. What is the reason for wanting
> to use batch
> processing if not for speed? I think we need to see a
> reasonable
> use case from someone advocating this change in order to
> justify it.
> (Note: "It works in MySQL" won't cut it.)
>
> -Kevin
>
I wrote earlier that the batch is independant form the will to make it a transaction for a few reasons:
a) you can't control the row locks involved in the batch, and you could end up in a deadlock. This is frequent when you just intended to pile up statements for another thread to call executebatch.
b) you just want to run a playlist of independant SQLs not related to each other and you don't expect some failures to prevent the others from running.
The batch works independantly from a transaction. I can't stress this differently. Maybe you have never used it this way, or learned it with a biased perspective that batches is only for transaction. I hope I gave a fresh perspective to make a better driver.
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: quartz12h@yahoo.com
Subject: Re: JDBC gripe list
In-Reply-To: <121151.6377.qm@web33207.mail.mud.yahoo.com>
References: <4D920984020000250003BF08@gw.wicourts.gov> <121151.6377.qm@web33207.mail.mud.yahoo.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