Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id C3F68B5DC01 for ; Mon, 19 Sep 2011 12:16:03 -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 40144-01 for ; Mon, 19 Sep 2011 15:15:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-fx0-f46.google.com (mail-fx0-f46.google.com [209.85.161.46]) by mail.postgresql.org (Postfix) with ESMTP id B5C46B5DC02 for ; Mon, 19 Sep 2011 12:15:55 -0300 (ADT) Received: by fxe4 with SMTP id 4so4010466fxe.19 for ; Mon, 19 Sep 2011 08:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=tDQzW4QlrTtQIxwuqlDhpgMZD0PFluGEss6G+IQt9kU=; b=fCjTX8J5vw+Pf8qMZdUgdZaSo2r6Gj/m6BT1jhKRPr6MYXfZuEYmZhrYDfqJUNkonH gUir7NJEpsclPxx6+HCBBPSt2eiR9i7NyWjD4AWyH7PP37JbGYsuab/2S6Q1TMroBwpD O41A/+u8WfZlGDeQx4Rk+MbCd+h8G2uve0lEY= Received: by 10.223.94.134 with SMTP id z6mr5305070fam.8.1316445354761; Mon, 19 Sep 2011 08:15:54 -0700 (PDT) Received: from [92.249.241.204] (92-249-241-204.pool.digikabel.hu. [92.249.241.204]) by mx.google.com with ESMTPS id w14sm22041646fae.13.2011.09.19.08.15.51 (version=SSLv3 cipher=OTHER); Mon, 19 Sep 2011 08:15:53 -0700 (PDT) Message-ID: <4E775CA7.3080303@gmail.com> Date: Mon, 19 Sep 2011 17:15:51 +0200 From: Bodor Andras User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101123 SeaMonkey/2.0.11 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: binary patch problems References: <4E4ADB2A.5040902@gmail.com> <4E53FE39.40501@gmail.com> <4E6FA3DA.5090805@gmail.com> <4E77155D.8050200@gmail.com> <4E7753F7.9090903@gmail.com> In-Reply-To: <4E7753F7.9090903@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.789 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.1, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201109/63 X-Sequence-Number: 22181 Self correction: I did not read the documentation carefully enough. prepareThreshold = 1 should be used. Negative values are changed to 0 by the driver. But it should be mentioned somewhere, that 0 switches it off completely. Bodor Andras wrote: > You are right. But then it is a bug in either the code, > or the documentation. It says: > > prepareThreshold = int > Determine the number of PreparedStatement executions required before > switching over to use server side prepared statements. > > I think, if zero executions are required, then the driver > should use prepared statement immediately. Both permanently > disabling and immediately enabling is a legitimate need of > the users, it should be clearly documented, how to do them. > Anyway, setting prepareThreshold = -1 will do what I meant. > But it is more logical to me, that 0 means zero and -1 means > infinity (even better: Integer.MAX_VALUE). > For the ForceBinaryTransfers I vote for dropping it, as > it adds unnecessary complications (and new bugs) to the > code. > Andras > >>> Why don't you set prepareThreshold to 0 for your test cases? >>> In this case parameter passing starts immediately for the >>> prepared statement, and ForceBinaryTransfers can be dropped. >>> Andras >>> > >AbstractJdbc2Statement: > > public boolean isUseServerPrepare() { > > return (preparedQuery != null && m_prepareThreshold != 0 && > >m_useCount + 1 >= m_prepareThreshold); > > } > > > >If I read the above correctly then prepareThreshold of 0 disables > >prepared statements. > > > >-Mikko