Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aXKfh-0007Yq-8x for pgsql-jdbc@arkaria.postgresql.org; Sun, 21 Feb 2016 03:26:57 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aXKfg-00068q-4W for pgsql-jdbc@arkaria.postgresql.org; Sun, 21 Feb 2016 03:26:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aXKff-00068Z-Ht for pgsql-jdbc@postgresql.org; Sun, 21 Feb 2016 03:26:55 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aXKfW-0000Aj-VE for pgsql-jdbc@postgresql.org; Sun, 21 Feb 2016 03:26:54 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id u1L3Qc704283 for ; Sat, 20 Feb 2016 19:26:38 -0800 Subject: Re: JDBC behaviour To: pgsql-jdbc@postgresql.org References: <4C508581-9CA3-490D-A376-CC1F9FF5D258@me.com> <56C8487F.7020406@hogranch.com> <20160220111625.4ee764661333e42e230348ad@potentialtech.com> <20160220120901.58bea0d780fad45775f04bfa@potentialtech.com> From: John R Pierce Message-ID: <56C92E6A.3000209@hogranch.com> Date: Sat, 20 Feb 2016 19:26:34 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org 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