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

Re: Stupid question on Read Committed Isolation Level

From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Stupid question on Read Committed Isolation Level
Date: 2004-01-29 18:09:07
Message-ID: 20040129140817.Q6922@ganymede.hub.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Thu, 29 Jan 2004, 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.

Thank you, that answers it ... so, simplistically, since they are both
hitting the same row, there is a pseudo-commit lock on that row by the
first transaction ...

----
Marc G. Fournier           Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org           Yahoo!: yscrappy              ICQ: 7615664

In response to

pgsql-hackers by date

Next:From: Chris BowlbyDate: 2004-01-29 18:16:23
Subject: Re: Stupid question on Read Committed Isolation Level
Previous:From: Marc G. FournierDate: 2004-01-29 18:07:25
Subject: Re: Stupid question on Read Committed Isolation Level

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