Re: JPA + Postgres = autocommit?

From: rob stone <floriparob(at)gmail(dot)com>
To: "Davygora, Yuriy" <Yuriy(dot)Davygora(at)sulzer(dot)de>, "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JPA + Postgres = autocommit?
Date: 2016-07-25 21:48:19
Message-ID: 1469483299.7543.9.camel@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message John R Pierce 2016-07-25 21:53:01 Re: JPA + Postgres = autocommit?
Previous Message Dennis Gesker 2016-07-25 18:27:04 Re: JPA + Postgres = autocommit?