Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id E2EF5B5DC02 for ; Mon, 19 Sep 2011 11:39:09 -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 63475-02 for ; Mon, 19 Sep 2011 14:39:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-bw0-f46.google.com (mail-bw0-f46.google.com [209.85.214.46]) by mail.postgresql.org (Postfix) with ESMTP id 4999BB5DBD1 for ; Mon, 19 Sep 2011 11:39:02 -0300 (ADT) Received: by bkbzt4 with SMTP id zt4so5348818bkb.19 for ; Mon, 19 Sep 2011 07:39:02 -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=N//QvWnMSWqrL8wbRMxukUEu1n2e+uZuCzYe3RC729o=; b=YssM6IF7vrvtMDUbbuGTkY81dS+MMXh032fh/pRt92REgqERBCXbgWhMFN9Bd4aNy1 JW8gCsIJzJd9vBXryokaQORDe2exM1Dn7ivCScFDlKWuxMmBjDXUuB2QKGGVjXXghCB0 Aw5PCVF7jjcM/VGEMg6xdGzBMh7lw5Zi5ukNg= Received: by 10.204.132.79 with SMTP id a15mr1646611bkt.329.1316443142792; Mon, 19 Sep 2011 07:39:02 -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 y8sm14357056bkb.4.2011.09.19.07.38.59 (version=SSLv3 cipher=OTHER); Mon, 19 Sep 2011 07:39:00 -0700 (PDT) Message-ID: <4E7753F7.9090903@gmail.com> Date: Mon, 19 Sep 2011 16:38:47 +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> In-Reply-To: <4E77155D.8050200@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/61 X-Sequence-Number: 22179 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