Skip site navigation (1) Skip section navigation (2)

Re: Stupid question on Read Committed Isolation Level

From: Chris Bowlby <chris(at)pgsql(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>,pgsql-hackers(at)postgresql(dot)org
Subject: Re: Stupid question on Read Committed Isolation Level
Date: 2004-01-29 18:16:23
Message-ID: 1075400182.92943.28.camel@morpheus.hub.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Would this not create the potention for a dead lock if transaction1 is
never completed, and still active for an indefinate period of time?

On Thu, 2004-01-29 at 14:06, Tom Lane wrote:
> "Marc G. Fournier" <scrappy(at)hub(dot)org> writes:
> > What happens if I abort on the first transaction?  If I'm reading this
> > right, if Trans2 does the exact same as above, and COMMITs before Trans1
> > Aborts, the value of balance becomes +200 (Trans2 + Trans1) ... but what
> > happens when Trans1 ABORTS?  Trans2 believes its COMMIT worked, but
> > ABORTng Trans1 will rollback to the original value, no?
> 
> If trans2 is the second to get to the row, it will *wait* until trans1
> either commits or aborts, and then use the new or old version of the row
> accordingly.  The scenario you are thinking of can't happen.
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
-- 
Chris Bowlby <chris(at)pgsql(dot)com>
PostgreSQL Inc.


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-01-29 18:21:34
Subject: Re: Stupid question on Read Committed Isolation Level
Previous:From: Marc G. FournierDate: 2004-01-29 18:09:07
Subject: Re: Stupid question on Read Committed Isolation Level

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group