Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRnkC-0006qu-He for pgsql-jdbc@arkaria.postgresql.org; Mon, 25 Jul 2016 21:49:00 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bRnkB-00057u-W6 for pgsql-jdbc@arkaria.postgresql.org; Mon, 25 Jul 2016 21:49:00 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bRnjh-0004ai-An for pgsql-jdbc@postgresql.org; Mon, 25 Jul 2016 21:48:29 +0000 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bRnje-0005B0-2A for pgsql-jdbc@postgresql.org; Mon, 25 Jul 2016 21:48:27 +0000 Received: by mail-qt0-x244.google.com with SMTP id u25so9156268qtb.3 for ; Mon, 25 Jul 2016 14:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:mime-version :content-transfer-encoding; bh=CuhatfNrBUSqx+Llws5p1VWfJOCPGwAc2XnfbphSn6Y=; b=mKnvPflndMHjMqVYjt4/OaE9x/xzH8wHgrR6GpnJDo3AXUk2MYzVzn9Xgo7n8H56F6 cDi6IZcGfRmcbW0TykJo0BM6/7CN9yUxdn3HQg0KpJOymG7rRPx3OuIRMVSjI9vvtArl /bQQEoBt1xGUEJHoj98kbp3q1YJLaobOuvpKxe92veBqNXXb7UsV5kkQF3HLyWw3DMQP rildijUwkEzwhC75DCu0WlvlG766aQt5V87KaLFjXdSswsCc1NxepwHcKnX3p6+WyvdY kCnjmKkZfZYUBtd49RROVRerNK8yNAo+1/38W7EV3AEKhQmOXkIdEtPzx/RpR/hXYXt+ w0YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=CuhatfNrBUSqx+Llws5p1VWfJOCPGwAc2XnfbphSn6Y=; b=OsI9IwKKtfO4zgzqm8zRNz6A2TWgMcdtQp67EWAwDheBVZY8aNcgXZf7sNErl0wAbs +5ijaB3Toh8denz68sslQH00sMJESi3bZbF4bn1ZDgywJcdE4ajvjUZrDkoU3VTHNcBJ bmiHAL6iCv0QlcVvadHFzvjYNDl5PGFPeL9mmqITM5dujV1UkcuQ9UN36TUSPM42dB8E DkH0JgZKk1ygUGNdyh4roRJBZz699byScjbAYJfV3NjH3MbwqJmxQdVqGGBk721J9tWC Br6UurDtBCg4Qk9T6zo+7d0E1h5fttZ/OYDty/xvJxpjtnIEdM9dVmwc3tGjQyB6cvrV PIUA== X-Gm-Message-State: AEkooutqZ/GWrEaDCzyMM1KkMqxTx8B9LwueLEyWP0Xsj1YJo/ac7gcYuBqZj5GtiCgtLw== X-Received: by 10.237.36.252 with SMTP id u57mr32605718qtc.39.1469483304461; Mon, 25 Jul 2016 14:48:24 -0700 (PDT) Received: from roblaptop ([189.101.207.228]) by smtp.gmail.com with ESMTPSA id n32sm16831906qkh.20.2016.07.25.14.48.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jul 2016 14:48:24 -0700 (PDT) Message-ID: <1469483299.7543.9.camel@gmail.com> Subject: Re: JPA + Postgres = autocommit? From: rob stone To: "Davygora, Yuriy" , "pgsql-jdbc@postgresql.org" Date: Tue, 26 Jul 2016 07:48:19 +1000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) 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 Mon, 2016-07-25 at 06:54 +0000, Davygora, Yuriy wrote: >   >   Hello, >   >   I am having a small but severe Problem with PostgreSQL. At our > company, we are currently developing a business application in Java > EE 7 running on a Payara (Glassfish fork) 4 server (with Eclipselink) > and we are using Postgres 9.5 as our database and the postgresql- > 9.4.1208 JDBC driver. Now, it seems that the connection to the > PostgreSQL database is in an autocommit mode. Transactions (both > container and bean managed) cannot be rolled back, every single SQL > command is executed and commited on flush(). >   >   Hello, I know nothing about Payara, etc. but the "traditional" way of handling this in an application is to:- BEGIN; Do your inserts/updates etc. COMMIT; or if you caught any errors during the inserting/updating, then ROLLBACK; See https://www.postgresql.org/docs/9.6/static/app-psql.html#APP-PSQL-VARIA BLES for more information about this setting in psql. HTH, Rob -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc