Re: Duplicate key issue in a transaction block

Поиск
Список
Период
Сортировка
От Ioana Danes
Тема Re: Duplicate key issue in a transaction block
Дата
Msg-id 915095.83936.qm@web45114.mail.sp1.yahoo.com
обсуждение исходный текст
Ответ на Duplicate key issue in a transaction block  (Ioana Danes <ioanasoftware@yahoo.ca>)
Список pgsql-general
--- On Mon, 6/8/09, Bill Moran <wmoran@potentialtech.com> wrote:

> From: Bill Moran <wmoran@potentialtech.com>
> Subject: Re: [GENERAL] Duplicate key issue in a transaction block
> To: "Ioana Danes" <ioanasoftware@yahoo.ca>
> Cc: "PostgreSQL General" <pgsql-general@postgresql.org>
> Received: Monday, June 8, 2009, 12:33 PM
> In response to Ioana Danes <ioanasoftware@yahoo.ca>:
> >
> > Hi Everyone,
> >
> > I have a hard to reproduce scenario for a production
> site....I tried to simplify the code and at the end I could
> get a similar problem with the following table and java
> code.
> > The problem is that I have a transaction that deletes
> all the records in a group and inserts the new records for
> that group. If that transaction is called from 2 different
> clients for the same groupid it happens to get a duplicate
> key violation which it should never happen on my
> opinion!!!!!!!!
>
> On what is that opinion based?  Considering the
> situation you describe, I
> would expect it to error every time you try to run that
> same script twice
> in parallel.

Well, you are right, I had a wrong understanding of Read Committed isolation level. I was expecting that my inserts
willsee only what was committed before the transaction begin not before the query begin.  

Thanks for your answer...



      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now
http://ca.toolbar.yahoo.com.

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: [SQL] 'cost' and 'rows' for volitile function
Следующее
От: Scott Mead
Дата:
Сообщение: Re: Adding the host name to the PgSQL shell