Re: JPA + Postgres = autocommit?

Поиск
Список
Период
Сортировка
От rob stone
Тема Re: JPA + Postgres = autocommit?
Дата
Msg-id 1469483299.7543.9.camel@gmail.com
обсуждение исходный текст
Ответ на JPA + Postgres = autocommit?  ("Davygora, Yuriy" <Yuriy.Davygora@sulzer.de>)
Ответы Re: JPA + Postgres = autocommit?  (John R Pierce <pierce@hogranch.com>)
Re: JPA + Postgres = autocommit?  (John R Pierce <pierce@hogranch.com>)
Список 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


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dennis Gesker
Дата:
Сообщение: Re: JPA + Postgres = autocommit?
Следующее
От: John R Pierce
Дата:
Сообщение: Re: JPA + Postgres = autocommit?