Re: Atomic operations?

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Atomic operations?
Дата
Msg-id 47E04DBB.8010801@opencloud.com
обсуждение исходный текст
Ответ на Re: Atomic operations?  (Dave Cramer <pg@fastcrypt.com>)
Ответы Re: Atomic operations?  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-jdbc
Dave Cramer wrote:
>
> On 18-Mar-08, at 9:40 AM, Paul Tomblin wrote:

>>   PreparedStatement ps = conn.prepareStatement(
>>      "DELETE FROM venue WHERE venueid = ? ; INSERT INTO VENUE
>> (venueid, .... ) VALUES(?, ?, ?, ?)");

>> Does that work?  Will that be atomic so that nobody else can insert
>> one with that venueid in between the delete and the insert?
>>
> I don't think so,

Actually it's fine the implicit transaction created by the server to
support autocommit wraps both queries in a single transaction and does
not commit/rollback until the end of the second query.

-O


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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: setQueryTimeout problem !?!?!
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: Atomic operations?