Re: Strange behavoir of batches

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Angelo Neuschitzer <an(at)jenomics(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Strange behavoir of batches
Date: 2005-09-12 21:59:57
Message-ID: 4325FA5D.2060402@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc

Angelo Neuschitzer wrote:

>> PreparedStatemet pStmt = con.prepareStatement("INSERT INTO table_a
>> VALUES (...)");
>> for(0 to 93)
>> {
>> [fill values into pStmt]
>> if(not last row)
>> {
>> pStmt.addBatch();
>> }
>> }
>> pStmt.executeBatch();
>> pStmt.clearBatch();

AFAIK, this "not last row" logic seems wrong. Calling executeBatch()
only executes those queries that have been added to the batch via
addBatch(), so the loop will lose the last INSERT.

-O

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Oliver Jowett 2005-09-12 22:06:25 Re: Strange behavoir of batches
Previous Message KLEBER SILVA 2005-09-12 20:01:40 could help me?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-09-12 22:06:25 Re: Strange behavoir of batches
Previous Message Heikki Linnakangas 2005-09-12 20:43:08 Re: XADataSource implementation