Re: JDBC behaviour

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC behaviour
Date: 2016-02-20 06:12:17
Message-ID: 56C803C1.2020904@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-jdbc

On 2/19/2016 8:40 PM, Sridhar N Bamandlapally wrote:
> one feature of PostgreSQL is implemented into another feature of Java
> ( i say subject PostgreSQL::autocommit Vs JDBC::setAutoCommit ),
> i.e PostgreSQL::"set autocommit to FALSE" is implemented as
> JDBC::"BEGIN-<statements>-END"
>
> currently PostgreSQL::"set autocommit to FALSE ( not supported )
>
> say in future, if PostgreSQL come with proper fix/support for "set
> autocommit to FALSE" then will JDBC-team change the to code to
> JDBC::"set autocommit to FALSE" ?, then what about existing behaviors
> dependency applications ?

in autocommit 'off' mode, most SQL databases start a transaction when
you execute any modifying query, these transactions are by default
atomic, and nothing is written til you commit. any errors cause the
transaction to be put in failure mode, and the whole thing has to be
rolled back. there are differing levels of transaction isolation
depending on database capabilities and settings, but most relational
transactional databases adhere to these basic semantics, and
transactions are all or nothing.

postgres differs only in that it is always in autocommit ON mode, unless
you begin a transaction explicitly with BEGIN. the net effect is
exactly the same.

--
john r pierce, recycling bits in santa cruz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Davies 2016-02-20 06:32:22 Re: Replacement for Oracle Text
Previous Message Chris Travers 2016-02-20 05:51:49 Re: Replacement for Oracle Text

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-02-20 08:25:55 Re: Typo in bufmgr.c that result in waste of memory
Previous Message Amit Langote 2016-02-20 05:08:56 Re: Declarative partitioning

Browse pgsql-jdbc by date

  From Date Subject
Next Message Craig Ringer 2016-02-20 10:44:41 Re: JDBC behaviour
Previous Message Sridhar N Bamandlapally 2016-02-20 04:40:46 Re: JDBC behaviour