pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Mauri Sahlberg <Mauri.Sahlberg@pretax.net>
Cc: pgsql-admin@postgresql.org
Cc: petri.hilska@pretax.net
Subject: Re: Parallel transactions failing oddly
Date: Thu, 31 Jul 2003 22:51:40 -0700 (PDT)
Message-ID: <20030731224348.M37793-100000@megazone.bigpanda.com> (raw)
In-Reply-To: <1059712650.6233.5.camel@taekwondo.intra.pretax.net>


On 1 Aug 2003, Mauri Sahlberg wrote:

> On pe, 2003-08-01 at 03:12, Stephan Szabo wrote:
> > > interface. If we run them one by one everything goes fine. But if I
> > > run them in parallel - in separate processes - all but the first one
> > > claiming the lock for "ryhmalaiset"-table will fail. And they will
> > > fail as soon as the first one is finished by trying to insert
> > > duplicate row in the shared table. Incidentally this row would also be
> > > the very first row they are trying to insert. They all run the same code
> > > but with different data.
> > >
> > The second transaction won't see the row inserted by the first transaction
> > until it commits (at best).  Both transactions can think there are no
> > matching rows.
>
> Umh, but as the "ryhmalaiset" table is locked until the transaction is
> commited? And what do you mean with "at best"? Is there any way ensuring
> that the other transactions won't access the table until the first one
> has finished updating it if the lock is not enough?

I said at best because I dont think serializable mode transactions won't
see the row even after commit as long as its snapshot's been taken
already.  You are locking the table in access exclusive mode right?





view thread (9+ messages)  latest in thread

Message-ID: <20030731224348.M37793-100000@megazone.bigpanda.com>
Permalink:  ../20030731224348.M37793-100000@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20030731224348.M37793-100000@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, Mauri.Sahlberg@pretax.net, petri.hilska@pretax.net
  Subject: Re: Parallel transactions failing oddly
  In-Reply-To: <20030731224348.M37793-100000@megazone.bigpanda.com>
  References: <1059712650.6233.5.camel@taekwondo.intra.pretax.net> <20030731224348.M37793-100000@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox