Re: Fwd: [JDBC] Fwd: [ADMIN] Confuse about the behaveior of PreparedStatement.executeBatch (jdbc)

From: "Kevin Grittner" <kgrittn(at)mail(dot)com>
To: "Haifeng Liu" <liuhaifeng(at)live(dot)com>,pgsql-general(at)postgresql(dot)org
Subject: Re: Fwd: [JDBC] Fwd: [ADMIN] Confuse about the behaveior of PreparedStatement.executeBatch (jdbc)
Date: 2012-12-14 17:03:37
Message-ID: 20121214170337.80050@gmx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Haifeng Liu wrote:

> Can anyone please figure out this ?

This was just answered on the JDBC list by Kris Jurka:

Internally the driver splits each batch into sub-batches of 250 to send to
the server to reduce the possibility of deadlocking the network
connection.  When auto-commit is enabled in the driver, the auto-commit
setting affects the whole sub-batch of 250 because of how the
frontend/backend protocol works.  So you are seeing some oddities because
of some implementation details and you should not use auto-commit with
batch statements.

-Kevin

Browse pgsql-general by date

  From Date Subject
Next Message James B. Byrne 2012-12-14 17:27:13 Re: Problem starting PG-9.2 on non-default port
Previous Message Merlin Moncure 2012-12-14 16:54:29 Re: XML Schema for PostgreSQL database