Re: JDBC behaviour - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: JDBC behaviour
Date
Msg-id CADK3HHKf+mwzr+N8gPj1-CNi2ohyVcf3fuNgtpBHpEOeUnFB6A@mail.gmail.com
Whole thread Raw
In response to Re: JDBC behaviour  (Mark Rotteveel <mark@lawinegevaar.nl>)
Responses Re: JDBC behaviour  (Mark Rotteveel <mark@lawinegevaar.nl>)
List pgsql-jdbc
On 18 February 2016 at 07:09, Mark Rotteveel <mark@lawinegevaar.nl> wrote:
On Thu, 18 Feb 2016 11:59:50 +0100 (CET), Andreas Joseph Krogh
<andreas@visena.com> wrote:
> På torsdag 18. februar 2016 kl. 11:43:36, skrev Sridhar N Bamandlapally
<
> sridhar.bn1@gmail.com <mailto:sridhar.bn1@gmail.com>>:
> The code/framework is written to handle batch inserts, which is common
for
> all
> databases 
> I feel, PostgreSQL JDBC may need to modify setAutoCommit(false) code to
> "implicit savepoint - on error - rollback to savepoint"
>
>  
> You simply cannot have batch-inserts in the same transaction and
expecting
> the
> batch not to fail if one of the statements in the batch fails.

On a lot of other database systems, that is exactly how it works. If a
statement fails, that one statement is backed out (rolled back), and it is
still up to the user to decide if he wants to commit or rollback the
statements that did succeed.

This behaviour is an artifact of PostgreSQL. If you want to change the transaction semantics of PostgreSQL then pgsql-hackers is the place to take this up.

JDBC is just an interface. We aren't going to rewrite the backend semantics to meet everyones needs/wants.


pgsql-jdbc by date:

Previous
From: Mark Rotteveel
Date:
Subject: Re: JDBC behaviour
Next
From: Mark Rotteveel
Date:
Subject: Re: JDBC behaviour