Re: [JDBC] JDBC behaviour

Поиск
Список
Период
Сортировка
От Sridhar N Bamandlapally
Тема Re: [JDBC] JDBC behaviour
Дата
Msg-id CAGuFTBV14KqA_DmX-_=xefZq7QKn0DER73HbX+dkDehrssqtuw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [JDBC] JDBC behaviour  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Ответы Re: [JDBC] JDBC behaviour  (Vladimir Sitnikov <sitnikov.vladimir@gmail.com>)
Re: [JDBC] JDBC behaviour  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
If we want transactions in "begin-end" then its fine, 

but in this case all these transactions are independent with autocommit off,

user choice to continue with commit or rollback

Thanks
Sridhar



On Thu, Feb 18, 2016 at 1:43 PM, Vladimir Sitnikov <sitnikov.vladimir@gmail.com> wrote:
>Is it a bug or do we have other any alternate way to handle this ?

PostgreSQL is strongly against "partial commits to the database". If
you think a bit about it, it is not that bad.
You got an error, what is the business case to commit the partial
transaction then?

Exceptions should not be used for a "control flow", should they?


If you want to shoot yourself in a foot for fun and profit, you can
try https://github.com/pgjdbc/pgjdbc/pull/477.
What it does, it creates savepoints before each statement, then it
rollbacks to that savepoint in case of failure.

Vladimir

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

Предыдущее
От: Victor Blomqvist
Дата:
Сообщение: Query plan not updated after dropped index
Следующее
От: Vladimir Sitnikov
Дата:
Сообщение: Re: [JDBC] JDBC behaviour