Re: Q about transactions

From: "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bruno Wolff III" <bruno(at)wolff(dot)to>, "postgresql" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Q about transactions
Date: 2003-04-24 06:55:00
Message-ID: 00b901c30a2e$6d0b5b20$aa0f5ac2@canaan.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Again, I thought about it a while and I still filling somewhat vague.

If in one transaction I start Serial mode and the other I start later in
Read Committed mode, what will happen if the Serializable transaction will
change some of the rows that the Read Committed is relay on ?

Thanks in Advance.

> "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il> writes:
> > When I want to insert a branch to the tree I need:
> > 1. select lft, rgt from the table to find where to insert
> > 2. using update I open a gap in the tree ( offset all the lft, rgt above
the
> > location by two )
> > 3. using insert I add a new branch.
>
> > so "select for updates" seem inappropriate as I select only one row as I
> > understood it lock only this row.
> > Read Committed is also bad as if the second transaction will use select
> > before the first transaction ran the update the select will be useless.
> > so it seems that Serializable isolation is the solution, or am I wrong ?
>
> Yeah. Use serializable mode, and be prepared to cope with "can't
> serialize" errors (a retry loop around the whole transaction is the
> standard answer to that).
>
> regards, tom lane
>
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://sites.canaan.co.il
--------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-04-24 09:15:27 Re: jdbc problem
Previous Message Stephan Szabo 2003-04-24 04:28:44 Re: Inheritence woes