Re: JDBC behaviour

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: JDBC behaviour
Дата
Msg-id 56C59D11.2070208@hogranch.com
обсуждение исходный текст
Ответ на Re: JDBC behaviour  (Sridhar N Bamandlapally <sridhar.bn1@gmail.com>)
Ответы Re: JDBC behaviour  (Sridhar N Bamandlapally <sridhar.bn1@gmail.com>)
Список pgsql-jdbc

if you want each insert to work indepedently yet stay with the
transaction model, then each insert should be its own transaction...


     conn.setAutoCommit(false);
     executeUpdate("insert into employee(id,name) values(1, 'K1')");
conn.commit();
     executeUpdate("insert into employee(id,name) values(1, 'K1')");
conn.commit();
     executeUpdate("insert into employee(id,name) values(1, 'K2')");
conn.commit();

otherwise the way you wrote it, its a single transaction.   all three
inserts have to succeed, otherwise, all three are rolledback.    why is
that so hard to understand?

--
john r pierce, recycling bits in santa cruz



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

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