executeBatch() and operation after error - Mailing list pgsql-jdbc

From Heiko W.Rupp
Subject executeBatch() and operation after error
Date
Msg-id FDFED6B5-8888-4B85-8D4F-5C133CF23392@redhat.com
Whole thread Raw
Responses Re: executeBatch() and operation after error
List pgsql-jdbc
Hi,

JDBC 3.0 spec speifies that in 15.1.3 a driver may continue
processing statements in a batch
if one of the statements throws an error.

Is this supported by the current driver? If yes, how can I enable this?

I have a use case where most of the time my application would very
much benefit from
using batches, but where sometimes the data to be inserted is already
there.

Of course there is the workaround to check for a BatchException and
then doing a
getUpdateCounts() to fall back inserting everyhing 'by hand'. But
obviously it is desirable
for e.g. a batch of 10 to only process statement #2 if this is
failing and having all other
statements be treated by the batching

   Heiko


--
Heiko W.Rupp
heiko.rupp@redhat.com, http://www.dpunkt.de/buch/3-89864-429-4.html




pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Problem with JDBC version 8.0/1 vs. 7.4
Next
From: Dave Cramer
Date:
Subject: Re: executeBatch() and operation after error