pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Lewis <mark.lewis@mir3.com>
To: Kris Jurka <books@ejurka.com>
Cc: Koth, Christian (DWBI) <Christian.Koth@smiths-heimann.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Using ON_ERROR_ROLLBACK functionality in JDBC
Date: Fri, 28 Jul 2006 08:58:01 -0700
Message-ID: <1154102281.1634.576.camel@archimedes> (raw)
In-Reply-To: <Pine.BSO.4.63.0607280353300.21507@leary2.csoft.net>
References: <F5F602C218633C419C7BCA6CDDC6E90A02445678@COSSMGMBX04.EMAIL.CORP.TLD>
	<Pine.BSO.4.63.0607280353300.21507@leary2.csoft.net>

Does the current savepoint implementation in the driver require a
separate round-trip?

-- Mark Lewis

On Fri, 2006-07-28 at 03:57 -0500, Kris Jurka wrote:
> 
> On Fri, 28 Jul 2006, Koth, Christian (DWBI) wrote:
> 
> > I would need the same functionality using JDBC. So I could continue with 
> > my batch insert even if one or more statements fail. Right now I'm 
> > committing the transaction after each insert.
> >
> > I have thought of the following:
> >
> > 1. Checking constraints before calling insert. (to slow)
> > 2. Creating a user defined savepoint before each insert,
> >   and rolling back to this savepoint if the insert fails. (not tried yet)
> >
> > What would you recommend? Is it possible to set ON_ERROR_ROLLBACK for 
> > JDBC transactions?
> 
> The JDBC driver does not currently support this behavior and if it did it 
> would implement it using 2) behind the scenes, so that's a good approach.
> 
> Also it's not clear what you mean by a batch, but the use of savepoints 
> will not allow things like Statement.executeBatch() to commit parts of a 
> batch.  It's all or nothing for these.
> 
> Kris Jurka
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly



view thread (6+ messages)  latest in thread

Message-ID: <1154102281.1634.576.camel@archimedes>
Permalink:  ../1154102281.1634.576.camel@archimedes/
Also on:    postgresql.org/message-id/1154102281.1634.576.camel@archimedes

 · 

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: mark.lewis@mir3.com, books@ejurka.com, Christian.Koth@smiths-heimann.com
  Subject: Re: Using ON_ERROR_ROLLBACK functionality in JDBC
  In-Reply-To: <1154102281.1634.576.camel@archimedes>
  References: <F5F602C218633C419C7BCA6CDDC6E90A02445678@COSSMGMBX04.EMAIL.CORP.TLD> <Pine.BSO.4.63.0607280353300.21507@leary2.csoft.net> <1154102281.1634.576.camel@archimedes>

* 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