pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: Heiko W.Rupp <heiko.rupp@redhat.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: executeBatch() and operation after error
Date: Mon, 15 Jan 2007 07:24:31 -0500
Message-ID: <55C00BEC-5B33-4358-875E-51A34D217071@fastcrypt.com> (raw)
In-Reply-To: <FDFED6B5-8888-4B85-8D4F-5C133CF23392@redhat.com>
References: <FDFED6B5-8888-4B85-8D4F-5C133CF23392@redhat.com>


On 15-Jan-07, at 6:13 AM, Heiko W.Rupp wrote:

> 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?
A cursory examination of the code suggests not.
>
> 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

Given  the semantics of postgresql transactions this would be onerous  
to implement. If a single statement fails in a transaction subsequent  
statements fail.

Dave
>
>   Heiko
>
>
> -- 
> Heiko W.Rupp
> heiko.rupp@redhat.com, http://www.dpunkt.de/buch/3-89864-429-4.html
>
>
>
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
>
>                http://www.postgresql.org/about/donate
>




view thread (2+ messages)

Message-ID: <55C00BEC-5B33-4358-875E-51A34D217071@fastcrypt.com>
Permalink:  ../55C00BEC-5B33-4358-875E-51A34D217071@fastcrypt.com/
Also on:    postgresql.org/message-id/55C00BEC-5B33-4358-875E-51A34D217071@fastcrypt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pg@fastcrypt.com, heiko.rupp@redhat.com
  Subject: Re: executeBatch() and operation after error
  In-Reply-To: <55C00BEC-5B33-4358-875E-51A34D217071@fastcrypt.com>
  References: <FDFED6B5-8888-4B85-8D4F-5C133CF23392@redhat.com> <55C00BEC-5B33-4358-875E-51A34D217071@fastcrypt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox