Skip site navigation (1) Skip section navigation (2)

Re: Curious behaviour with Execute Batch and Prepared Statements

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Brett Walker <brett(dot)walker(at)geometryit(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Curious behaviour with Execute Batch and Prepared Statements
Date: 2012-06-25 04:34:25
Message-ID: 4FE7EA51.60308@ringerc.id.au (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

Responses

pgsql-jdbc by date

Next:From: Brett WalkerDate: 2012-06-25 10:23:41
Subject: Re: Curious behaviour with Execute Batch and Prepared Statements
Previous:From: Brett WalkerDate: 2012-06-24 13:44:43
Subject: Re: Curious behaviour with Execute Batch and Prepared Statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group