Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 4029C1337999 for ; Wed, 19 Jan 2011 05:49:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 08734-07 for ; Wed, 19 Jan 2011 09:49:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id 98F6C13364DE for ; Wed, 19 Jan 2011 05:49:32 -0400 (AST) Received: by fxm20 with SMTP id 20so658445fxm.19 for ; Wed, 19 Jan 2011 01:49:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=TvAAfMQyFzFzqmmf+9a4Sq7s4Ht2H8wzt2kwntE1GHI=; b=lH/zvJelyb0ivG7alOkaFOD2+diSNSV4IR7ErjKWhei/Ok2CDwgmoCXd5ax1C67TrI tpdvOtZZsOEhO5HXXE6Wz+J6rDhw94tjU+i6AWB9R2J4tPx8BbQ0ci9ncXsiWy0w8j+N tH807jrtKczd8M3RLpemxb9AdkodayYWkLxc4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=VEgDaOxpvF8l5+eMq9VBnI8uZm+I5ZAq9fuMLEa89IFBt2I3lNS8iMay20lU4mmPPk Lj+9JfHFBgpR7u0UR7FQv6GFm/P2+aJDSZ19gm44HEYnui1XHVmtjGR1ppzErSGdYtrv sv7nzA0diygCngaMunL0kVnHhS2uaZPO0VqWQ= Received: by 10.223.98.197 with SMTP id r5mr484468fan.68.1295430571662; Wed, 19 Jan 2011 01:49:31 -0800 (PST) Received: from [10.1.1.57] (skuns.zoral.com.ua [91.193.166.194]) by mx.google.com with ESMTPS id n26sm2484119fam.13.2011.01.19.01.49.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Jan 2011 01:49:30 -0800 (PST) Message-ID: <4D36B3C7.1030309@gmail.com> Date: Wed, 19 Jan 2011 11:49:59 +0200 From: Vitalii Tymchyshyn User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: jdbc spec violation for autocommit=true & addbatch/executeBatch References: <654041.58993.qm@web33207.mail.mud.yahoo.com> <4D3606CD.7080707@opencloud.com> In-Reply-To: <4D3606CD.7080707@opencloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.036 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=1.553, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201101/57 X-Sequence-Number: 21389 18.01.11 23:31, Oliver Jowett написав(ла): > > I'm not sure if we can implement this according to the current spec > without losing any performance benefit of addBatch()/executeBatch() - > we'd have to send a Sync after every individual query. But is roundtrip needed for each sync? Can't we send all the data + as much syncs as needed and then collect responses. The only thing that bothers me is famous bug when receive and then send buffer overflows. > As a workaround I suggest you just run the queries individually, not > in a batch - there won't be much performance difference. (And if you > really don't care about ordering or atomicity as you imply, you could > parallelize it across multiple connections if latency is a problem) How about addBatch("commit") after each addBatch("update")? This should work in very similar way to sending Sync after each query. Best regards, Vitalii Tymchyshyn