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.