Search Postgresql Archives

Re: Duplicate key issue in a transaction block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Mon, 6/8/09, Bill Moran <wmoran@xxxxxxxxxxxxxxxxx> wrote:

> From: Bill Moran <wmoran@xxxxxxxxxxxxxxxxx>
> Subject: Re:  Duplicate key issue in a transaction block
> To: "Ioana Danes" <ioanasoftware@xxxxxxxx>
> Cc: "PostgreSQL General" <pgsql-general@xxxxxxxxxxxxxx>
> Received: Monday, June 8, 2009, 12:33 PM
> In response to Ioana Danes <ioanasoftware@xxxxxxxx>:
> > 
> > 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 will see 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.

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux