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: Sat, 20 Feb 2016 19:26:34 -0800
Message-ID: <56C92E6A.3000209@hogranch.com> (raw)
In-Reply-To: <CAGuFTBXPCWEUYq_e4nabgDu+cuM_sJxWt9QxQKgsd9D2SuA0hw@mail.gmail.com>
References: <VisenaEmail.10e.692062643617cb13.152f4695802@tc7-visena>
	<CAGuFTBXSwk2UmFs_b0wYuTv_BFtLwVmco1mgT5OSb+dwX-U+Sw@mail.gmail.com>
	<4C508581-9CA3-490D-A376-CC1F9FF5D258@me.com>
	<CAGuFTBW_xcn5nWtggiwq46f=6Rc5TYEqwtmiWEEGGfB+PSLbUg@mail.gmail.com>
	<CAMsr+YH3NHZ__xSxWfVH4neGa6w8nLRuLLRG8kqXt9bgE1eEBA@mail.gmail.com>
	<56C8487F.7020406@hogranch.com>
	<CAMsr+YF6nj0Qh+A0J3hJrQD1ofwq_=k_tXUewb0EQO_0uj7Azg@mail.gmail.com>
	<CAKFQuwbo6QZ7dae91mPcnXJyija4EfDX4=F_ULta2hXf4XwbEw@mail.gmail.com>
	<CABWW-d3Mu=vto2ML22Q+iQe-znNkQLyyew_FJmZn086oBLiqKA@mail.gmail.com>
	<20160220111625.4ee764661333e42e230348ad@potentialtech.com>
	<CABWW-d3dDrDQbKA1uh5o3XzFcLrzc7QtHkRsxSdrznUUD=Vq6Q@mail.gmail.com>
	<20160220120901.58bea0d780fad45775f04bfa@potentialtech.com>
	<CABWW-d3kagq=8EnXFRzc7Jzij08DNY0VbdT=ZcSa48rnuQXOYg@mail.gmail.com>
	<CADK3HHJ5PW1GBgRiy22UsXoCtJT_G=pY74nXpUAbVA6qiX27rA@mail.gmail.com>
	<CAGuFTBXPCWEUYq_e4nabgDu+cuM_sJxWt9QxQKgsd9D2SuA0hw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On 2/20/2016 6:20 PM, Sridhar N Bamandlapally wrote:
> from Java/jdbc code, conn.setAutoCommit(false)
>
> insert into employee values(1, 'K1');
> insert into employee values(1, 'K1');
> insert into employee values(2, 'K2');
>
> by looking at exceptions i may rollback or commit, i.e. 
> conn.rollback() or conn.commit()
> if I rollback table should be empty,
> if I commit table should have 2 rows
>
> is there any way is possible ?



turn on autocommit if you want each INSERT to be run atomically 
independent of the other inserts.

this is going in circles, we've explained a dozens how postgres and jdbc 
works.


-- 
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: <56C92E6A.3000209@hogranch.com>
Permalink:  ../56C92E6A.3000209@hogranch.com/
Also on:    postgresql.org/message-id/56C92E6A.3000209@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: <56C92E6A.3000209@hogranch.com>
  References: <VisenaEmail.10e.692062643617cb13.152f4695802@tc7-visena> <CAGuFTBXSwk2UmFs_b0wYuTv_BFtLwVmco1mgT5OSb+dwX-U+Sw@mail.gmail.com> <4C508581-9CA3-490D-A376-CC1F9FF5D258@me.com> <CAGuFTBW_xcn5nWtggiwq46f=6Rc5TYEqwtmiWEEGGfB+PSLbUg@mail.gmail.com> <CAMsr+YH3NHZ__xSxWfVH4neGa6w8nLRuLLRG8kqXt9bgE1eEBA@mail.gmail.com> <56C8487F.7020406@hogranch.com> <CAMsr+YF6nj0Qh+A0J3hJrQD1ofwq_=k_tXUewb0EQO_0uj7Azg@mail.gmail.com> <CAKFQuwbo6QZ7dae91mPcnXJyija4EfDX4=F_ULta2hXf4XwbEw@mail.gmail.com> <CABWW-d3Mu=vto2ML22Q+iQe-znNkQLyyew_FJmZn086oBLiqKA@mail.gmail.com> <20160220111625.4ee764661333e42e230348ad@potentialtech.com> <CABWW-d3dDrDQbKA1uh5o3XzFcLrzc7QtHkRsxSdrznUUD=Vq6Q@mail.gmail.com> <20160220120901.58bea0d780fad45775f04bfa@potentialtech.com> <CABWW-d3kagq=8EnXFRzc7Jzij08DNY0VbdT=ZcSa48rnuQXOYg@mail.gmail.com> <CADK3HHJ5PW1GBgRiy22UsXoCtJT_G=pY74nXpUAbVA6qiX27rA@mail.gmail.com> <CAGuFTBXPCWEUYq_e4nabgDu+cuM_sJxWt9QxQKgsd9D2SuA0hw@mail.gmail.com> <56C92E6A.3000209@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