From: rob stone <floriparob@gmail.com>
To: Davygora, Yuriy <Yuriy.Davygora@sulzer.de>
To: pgsql-jdbc@postgresql.org <pgsql-jdbc@postgresql.org>
Subject: Re: JPA + Postgres = autocommit?
Date: Tue, 26 Jul 2016 07:48:19 +1000
Message-ID: <1469483299.7543.9.camel@gmail.com> (raw)
In-Reply-To: <B204CB55F9D32D41A9A5413EA3F13F8C3BEC6C20@email.sulzer.de>
References: <B204CB55F9D32D41A9A5413EA3F13F8C3BEC6C20@email.sulzer.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
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
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: floriparob@gmail.com, Yuriy.Davygora@sulzer.de
Subject: Re: JPA + Postgres = autocommit?
In-Reply-To: <1469483299.7543.9.camel@gmail.com>
References: <B204CB55F9D32D41A9A5413EA3F13F8C3BEC6C20@email.sulzer.de> <1469483299.7543.9.camel@gmail.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