pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John R Pierce <pierce@hogranch.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: JDBC behaviour
Date: Thu, 18 Feb 2016 01:52:45 -0800
Message-ID: <56C5946D.4070904@hogranch.com> (raw)
In-Reply-To: <CAGuFTBUm6833idGepWE9KBP87nYBuzHpTqwmf0981wCdS13K0w@mail.gmail.com>
References: <CAGuFTBXf_1Vws=Ja3nCqvRGvWPE2W4ATpCyxrreCgWFi0Yii=w@mail.gmail.com>
	<VisenaEmail.fd.a0847dd522e46d81.152f3b0448d@tc7-visena>
	<CAGuFTBXnVvX8cmbxF7HYhfrTQf9_pUTU=Lq2F4Niq-4jiObCzg@mail.gmail.com>
	<CAGuFTBUm6833idGepWE9KBP87nYBuzHpTqwmf0981wCdS13K0w@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 2/18/2016 1:42 AM, Sridhar N Bamandlapally wrote:
>
> but why?, this is not expected behavior
>
> autocommit is just autocommit, its not responsible to treat 
> multi-transactions as single or independent
>
>

its exactly how jdbc is defined to work,  fit into postgres's 
transaction model.

if autocommit is ON, then every statement is a standalone query.

if autocommit is OFF, then its in transaction mode.     JDBC has an 
implicit transaction start when you execute the first query, and you 
have to commit or rollback the transaction.


if you want each INSERT to run indepedently, then use autocommit ON.

-- 
john r pierce, recycling bits in santa cruz



-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



view thread (73+ messages)  latest in thread

Message-ID: <56C5946D.4070904@hogranch.com>
Permalink:  ../56C5946D.4070904@hogranch.com/
Also on:    postgresql.org/message-id/56C5946D.4070904@hogranch.com

 · 

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: pierce@hogranch.com
  Subject: Re: JDBC behaviour
  In-Reply-To: <56C5946D.4070904@hogranch.com>
  References: <CAGuFTBXf_1Vws=Ja3nCqvRGvWPE2W4ATpCyxrreCgWFi0Yii=w@mail.gmail.com> <VisenaEmail.fd.a0847dd522e46d81.152f3b0448d@tc7-visena> <CAGuFTBXnVvX8cmbxF7HYhfrTQf9_pUTU=Lq2F4Niq-4jiObCzg@mail.gmail.com> <CAGuFTBUm6833idGepWE9KBP87nYBuzHpTqwmf0981wCdS13K0w@mail.gmail.com> <56C5946D.4070904@hogranch.com>

* 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