Re: JDBC behaviour

From: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
To: Mark Rotteveel <mark(at)lawinegevaar(dot)nl>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JDBC behaviour
Date: 2016-02-18 12:51:32
Message-ID: CAB=Je-Gv6-RYpkF-bbURfKbespD2_hFEF-KaNGVeUMAbXx7+GA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-jdbc

Unfortunately, OP seems to ignore all the inputs, thus no "advanced"
recommendations.

Mark>I understand that and indeed this isn't something that should be handled
Mark>by the driver

psql has special "transparent auto-rollback-to-auto-savepoint", thus
there's a certain trend to workaround database strictness.

As I posted earlier, there is a work-in-progress implementation of
exactly that functionality at the driver level:
https://github.com/pgjdbc/pgjdbc/pull/477
Of course it won't be able to "rollback just a single row of a whole
batch", however batch DML is often split to sub-batches. The
savepoints can be in between those sub-batches.

Just one more time:
1) If the application is developed via PostgreSQL from the ground up,
then "transacted aborted" is more likely to be a feature.
2) If the application is migrated from other databases, then excessive
strictness might be a "bug". That is, the application should be
eventually be adapted not to throw exceptions, however, "transaction
aborted" might easily be a blocker to migration to PG. Frankly
speaking, "autosavepoint" is somewhat that might sense. It is not
something crazy like returning 0 from 0/0.

Vladimir

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mark Rotteveel 2016-02-18 13:36:50 Re: JDBC behaviour
Previous Message Andreas Joseph Krogh 2016-02-18 12:48:04 Re: JDBC behaviour

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-02-18 13:08:49 Re: a raft of parallelism-related bug fixes
Previous Message Andreas Joseph Krogh 2016-02-18 12:48:04 Re: JDBC behaviour

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mark Rotteveel 2016-02-18 13:36:50 Re: JDBC behaviour
Previous Message Andreas Joseph Krogh 2016-02-18 12:48:04 Re: JDBC behaviour