Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 2A6CA1337C1D for ; Wed, 6 Apr 2011 13:11:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 13722-04-6 for ; Wed, 6 Apr 2011 16:11:21 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from web33202.mail.mud.yahoo.com (web33202.mail.mud.yahoo.com [209.191.69.150]) by mail.postgresql.org (Postfix) with SMTP id E92591337C06 for ; Wed, 6 Apr 2011 13:11:20 -0300 (ADT) Received: (qmail 50264 invoked by uid 60001); 6 Apr 2011 16:11:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1302106279; bh=LaTpni+PqvhlUCvkRxz2nwk4hsVJVXRJ7m/nEeuSbhU=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=IFwHj3Gh+oNhkTLFelEohNfGsyUrzCL8H6NIwHbjnhMyDu8FeFbopdUMzO0w+NdZLvkyxJ1o+VfJl4Wsu8hwm/uZgYRRgx3TAPP8xBkkNY5KEK0wLFB+wOk2d5cuO4ryVeTYy9AGVYxFWREgZiPLJq5eAmiRhP4F2y/y0qThdxA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=oJxUKlWSiq/+EBmu1DVarHT6avwKOERGPdpoStpnLPYzqtdrJOW3xtW8ytcYaYeoGj9d59mwpYLYV+68uoEgZIDzeE750c83HURLXGws8vw4KuSFbWVGFbURx0PrFM2tPp2Wxf30nP0pTQau14zCsXowSV3Sy43zptNDHsz4Mz0=; Message-ID: <677089.43685.qm@web33202.mail.mud.yahoo.com> X-YMail-OSG: nF.MQuUVM1ko0qwORK_c3PLNEqk6Q.EFM2OQNwPBqcq3fmX 2bZuzHH4ux5FI5fgtcGhRFZ_S4t6AK7ShhjAZaav1T2clUVcTZT0woYEARsz 43wUBISSwEC7dQFIA7o0bG88zaVIDpx3Mcl5sYO28nYP8vDG9QZZxctgQose JxX73wkGRH_UvwFtdddWoaKj6or7xepRpZ3lPyNLhJkukFAsS.G5F0rvO5G5 AZKirll54wXBC26BqnAFXyn16qjEfIrE1k882zzpfD7UUjrQqk71BPmBY4jr DgaaozZYnHR.CK1FiGfa7NoGHDDb3YY.A.EhvfZ6DpNnQt10X0Z7WhSXCG93 pPiwZhFGB2yuVYl5BZuzuRkBZ7ie4v7sK235ugj4E3zKALaKg4ITsM3xGOXA 3RB7ygVes5ywH Received: from [199.84.5.210] by web33202.mail.mud.yahoo.com via HTTP; Wed, 06 Apr 2011 09:11:19 PDT X-Mailer: YahooMailClassic/12.0.2 YahooMailWebService/0.8.109.295617 Date: Wed, 6 Apr 2011 09:11:19 -0700 (PDT) From: Quartz Subject: Re: JDBC gripe list (the autocommit subthread) To: Dave Cramer Cc: Kevin Grittner , pgsql-jdbc@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/39 X-Sequence-Number: 21765 Once again...=0A=0AYou cannot assume a batch is a transaction. Especially, = it may deadlock when application are batching statements expecting that aff= ected rows won't be locked in groups.=0A=0A=0A=0A=0A--- On Fri, 4/1/11, Dav= e Cramer wrote:=0A=0A> From: Dave Cramer =0A> Subject: Re: [JDBC] JDBC gripe list (the autocommit subthread)=0A> = To: "Quartz" =0A> Cc: "Kevin Grittner" , pgsql-jdbc@postgresql.org=0A> Received: Friday, April 1, 20= 11, 5:49 AM=0A> So what is the use case for=0A> autocommit =3D true for bat= ch inserts ?=0A> =0A> to me the whole point of batch inserts is speed with= =0A> autocommit=3D false=0A> it should be faster. I would also think the lo= gic is much=0A> simpler if I=0A> get an all or nothing commit.=0A> =0A> =0A= > Dave Cramer=0A> =0A> dave.cramer(at)credativ(dot)ca=0A> http://www.credat= iv.ca=0A> =0A> =0A> =0A> =0A> On Thu, Mar 31, 2011 at 5:34 PM, Quartz =0A> wrote:=0A> >> I'm coming around to the position that w= e=0A> shouldn't tinker=0A> >> with=0A> >> autoCommit within the executeBatc= h method.=A0 I=0A> still=0A> >> think it would=0A> >> be best for us to con= sistently bail out on the=0A> first=0A> >> failure, but if=0A> >> autoCommi= t is on, we could build the=0A> BatchUpdateException=0A> >> using an=0A> >>= array of the length of the successfully completed=0A> >> statements.=A0 If= =0A> >> autoCommit is off, I'm not sure whether it would=0A> be better=0A> = >> to leave=0A> >> the updateCounts property null or use a zero=0A> length = array;=0A> >> but=0A> >> clearly no statements should be considered=0A> suc= cessful.=0A> >>=0A> >> The API documentation does seem to suggest it=0A> sh= ould work=0A> >> that way.=0A> >>=0A> >> The bad news is that this would be= a behavior=0A> change, and=0A> >> could thus=0A> >> break existing code fo= r current PostgreSQL users.=0A> >> When that's the=0A> >> case, we generall= y like to see a reasonable use=0A> case for=0A> >> the new=0A> >> behavior = even when it is standard.=A0 So far we=0A> have a=0A> >> rather=0A> >> hand= -wavy assertion that it would be useful for=0A> logging and=0A> >> "an=0A> = >> infinite number of" other uses.=A0 It would=0A> probably=0A> >> help swa= y the=0A> >> community if there was a more concrete explanation=0A> of why= =0A> >> this was=0A> >> better than the alternatives for logging purposes,= =0A> and to=0A> >> sketch out=0A> >> one or two of the other infinite numbe= r of use=0A> cases.=0A> >=0A> >=0A> > You have been defending all that long= that most use=0A> the autocommit=3Dfalse when using batches. Then they won= 't=0A> break....!=0A> >=0A> > Besides that's what release notes are for. An= d I dare=0A> say, if they expected a transaction when using a batch with=0A= > autocommit=3Dtrue, it about time they learn their mistake.=0A> JDBC api i= s a contract. Can't make exception for postgres.=0A> >=0A> >=0A> > --=0A> >= Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)=0A> > To make= changes to your subscription:=0A> > http://www.postgresql.org/mailpref/pgs= ql-jdbc=0A> >=0A>