Re: Atomic operations?

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Atomic operations?
Дата
Msg-id D1937C2E-5870-4493-BF37-C89BDC88423E@fastcrypt.com
обсуждение исходный текст
Ответ на Re: Atomic operations?  (Oliver Jowett <oliver@opencloud.com>)
Ответы Re: Atomic operations?  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
On 18-Mar-08, at 7:18 PM, Oliver Jowett wrote:

> 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.
>
Yeah, using v3 protocol this is presented as one prepare/execute.
Thanks for catching that.
> -O
>
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc


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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: Atomic operations?
Следующее
От: "Woody Woodring"
Дата:
Сообщение: Re: JDBC rewriting a bad query?