Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 84DD52B2862 for ; Mon, 25 Jun 2012 01:34:47 -0300 (ADT) Received: from mail-pz0-f46.google.com ([209.85.210.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sj10g-0000Kx-0x for pgsql-jdbc@postgresql.org; Mon, 25 Jun 2012 04:34:47 +0000 Received: by dady13 with SMTP id y13so4783267dad.19 for ; Sun, 24 Jun 2012 21:34:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=Qn5MQ5PXBOQ/Q8PlV+a36UNdwgYqQ6dY0N0tJAbHV6A=; b=OdkpVa8fG2ccX9/UNn7Rj0J8b6ogN6Eo+OQ5E+mf5Lb4eWZIPAG8reDbCl3Z4jab63 7fdJtMzfkkLP9iTUabKNP0Qe5JKUJCqxrIVrXkJARIWfmlGfLrYnA1XtSirIFP0q6xJh KdG7vltO/FgH+fynO3krq/TQ7bqG2Fklk4mwi8iWmzackzfWNkY37qTCJ6sNzaIug5s5 0JfC33URu7Yj1SttPk5FnB4ijQJ86V1iQAw1PCwt5ZBTL886Ez7u/98xoiEezafQXC6C Zwwl3jrHZEmrLUo96FK37gWCgN2OsY3JBeqa4ZJNmunLfmxJCsJ0Wlpu2FqlxZ76FnTQ VX0A== Received: by 10.68.201.7 with SMTP id jw7mr36111554pbc.60.1340598872414; Sun, 24 Jun 2012 21:34:32 -0700 (PDT) Received: from ayaki.localdomain (124-169-169-118.dyn.iinet.net.au. [124.169.169.118]) by mx.google.com with ESMTPS id x1sm7271121pbp.50.2012.06.24.21.34.28 (version=SSLv3 cipher=OTHER); Sun, 24 Jun 2012 21:34:31 -0700 (PDT) Message-ID: <4FE7EA51.60308@ringerc.id.au> Date: Mon, 25 Jun 2012 12:34:25 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: Brett Walker CC: "pgsql-jdbc@postgresql.org" Subject: Re: Curious behaviour with Execute Batch and Prepared Statements References: <4B95BC7335A13A42AD0D23462F91AE6F6163F1445A@echo.geometryit.com> In-Reply-To: <4B95BC7335A13A42AD0D23462F91AE6F6163F1445A@echo.geometryit.com> Content-Type: multipart/alternative; boundary="------------070407000408090603060809" X-Gm-Message-State: ALoCoQk1riwUqmaS59l2Oi3ssFP4sFNRPTF62RH7n9S4fiz1jWzVX8ffP2lCiC0QRKoG8ZCPBIon X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/86 X-Sequence-Number: 23080 This is a multi-part message in MIME format. --------------070407000408090603060809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 06/24/2012 01:58 PM, Brett Walker wrote: > > I have a problem that I have described on stackoverflow. It is here: > http://stackoverflow.com/questions/11167471/curious-behaviour-with-executebatch-and-prepared-statements > OK, so you've set log_statement = 'all' and restarted or reloaded Pg, re-run your test, and you still don't see the statement hitting the DB? You've possibly found a bug. Now you need to narrow it down. Does this fail if you run the same statement against 9.1? ie is it specifically a PgJDBC 9.1 vs PostgreSQL 8.3 issue? Or does it happen irrespective of the version of PostgreSQL being targeted? Does the issue exist in older versions of PgJDBC too? Try enabling detailed logging in PgJDBC and see if you can make out what's going wrong. See: http://jdbc.postgresql.org/documentation/91/connect.html#connection-parameters and 'loglevel' .Set loglevel = 2 in the JDBC driver and re-run your tests. If that doesn't help: Grab the PgJDBC sources. Attach a debugger to the test and step through the problem statement execution. Watch what PgJDBC is doing, see where it goes wrong. If you don't want to do all that: Create a self-contained test case as a standalone Java program (source, ant or maven build, all dependencies, etc) that can simply be downloaded and run against a clean PostgreSQL database to demonstrate your problem. You'll want to provide a .sql script to set up the test environment by populating the database too. -- Craig Ringer --------------070407000408090603060809 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 06/24/2012 01:58 PM, Brett Walker wrote:

I have a problem that I have described on stackoverflow. It is here: http://stackoverflow.com/questions/11167471/curious-behaviour-with-executebatch-and-prepared-statements


OK, so you've set log_statement = 'all' and restarted or reloaded Pg, re-run your test, and you still don't see the statement hitting the DB? You've possibly found a bug. Now you need to narrow it down.

Does this fail if you run the same statement against 9.1? ie is it specifically a PgJDBC 9.1 vs PostgreSQL 8.3 issue? Or does it happen irrespective of the version of PostgreSQL being targeted?  Does the issue exist in older versions of PgJDBC too?

Try enabling detailed logging in PgJDBC and see if you can make out what's going wrong. See: http://jdbc.postgresql.org/documentation/91/connect.html#connection-parameters and 'loglevel' .Set loglevel = 2 in the JDBC driver and re-run your tests.

If that doesn't help: Grab the PgJDBC sources. Attach a debugger to the test and step through the problem statement execution. Watch what PgJDBC is doing, see where it goes wrong.

If you don't want to do all that: Create a self-contained test case as a standalone Java program (source, ant or maven build, all dependencies, etc) that can simply be downloaded and run against a clean PostgreSQL database to demonstrate your problem. You'll want to provide a .sql script to set up the test environment by populating the database too.

--
Craig Ringer
--------------070407000408090603060809--