Re: Locking entire database

From: Panagiotis Pediaditis <pped(at)ics(dot)forth(dot)gr>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Locking entire database
Date: 2007-09-14 16:07:22
Message-ID: 46EAB1BA.4050501@ics.forth.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A simpler example,
In the context of one transaction i do many queries of the form
INSERT INTO table value WHERE value NOT IN TABLE;

If i have 2 processes running the same 100s of these at the same time i
end up with duplicates.
Even with isolation set to serializable
any ideas?
thnx

Panagiotis

Thomas Kellerer wrote:
> Panagiotis Pediaditis, 14.09.2007 16:45:
>> Well the problem is I am working on rdf query engine for persistent
>> RDF data. The data is stored/structured in a specific way in the
>> database. When i perform updates in parallel, because there are cross
>> table dependencies, I end up with inconsistencies, For example One
>> transaction reads to see if there is a resource so as to add a
>> property where it is a subject. Then an other transaction deletes the
>> resource after the first has decided that the resource is there but
>> before it added the property.
>> Thus it would be helpful for me to avoid the difficult task of
>> dependency based locking and just lock the whole database.
>> any ideas?
>
> Hmm. To me this sounds like all those steps should in fact be _one_
> transaction and not several transactions.
>
> Thomas
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-09-14 16:20:19 Re: Inherited FK Indexing
Previous Message Bruce Momjian 2007-09-14 15:54:02 Re: Documentation fix regarding atan2