Re: Curious behaviour with Execute Batch and Prepared Statements - Mailing list pgsql-jdbc

From Brett Walker
Subject Re: Curious behaviour with Execute Batch and Prepared Statements
Date
Msg-id 4B95BC7335A13A42AD0D23462F91AE6F6163F67060@echo.geometryit.com
Whole thread Raw
In response to Re: Curious behaviour with Execute Batch and Prepared Statements  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-jdbc
Thanks Craig.

It was a bug. After spending a day away from the code and then looking at it for half an hour all refreshed I saw the
bugthat I had introduced. See the stackoverflow question. 

Thanks agian for all your comments.

Brett
________________________________________
From: Craig Ringer [ringerc@ringerc.id.au]
Sent: Monday, 25 June 2012 2:34 PM
To: Brett Walker
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] Curious behaviour with Execute Batch and Prepared Statements

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
statementhitting 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?
Ordoes it happen irrespective of the version of PostgreSQL being targeted?  Does the issue exist in older versions of
PgJDBCtoo? 

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-parametersand 'loglevel' .Set loglevel = 2 in the
JDBCdriver 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
yourproblem. You'll want to provide a .sql script to set up the test environment by populating the database too. 

--
Craig Ringer

pgsql-jdbc by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Curious behaviour with Execute Batch and Prepared Statements
Next
From: Robert Jacoby
Date:
Subject: Forward compatibility of drivers