Re: JDBC behaviour

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: JDBC behaviour
Дата
Msg-id 56C5946D.4070904@hogranch.com
обсуждение исходный текст
Ответ на Re: JDBC behaviour  (Sridhar N Bamandlapally <sridhar.bn1@gmail.com>)
Ответы Re: JDBC behaviour  (Sridhar N Bamandlapally <sridhar.bn1@gmail.com>)
Список pgsql-jdbc
On 2/18/2016 1:42 AM, Sridhar N Bamandlapally wrote:
>
> but why?, this is not expected behavior
>
> autocommit is just autocommit, its not responsible to treat
> multi-transactions as single or independent
>
>

its exactly how jdbc is defined to work,  fit into postgres's
transaction model.

if autocommit is ON, then every statement is a standalone query.

if autocommit is OFF, then its in transaction mode.     JDBC has an
implicit transaction start when you execute the first query, and you
have to commit or rollback the transaction.


if you want each INSERT to run indepedently, then use autocommit ON.

--
john r pierce, recycling bits in santa cruz



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

Предыдущее
От: Andreas Joseph Krogh
Дата:
Сообщение: Re: JDBC behaviour
Следующее
От: Sridhar N Bamandlapally
Дата:
Сообщение: Re: JDBC behaviour