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