Re: Stupid question on Read Committed Isolation Level

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Stupid question on Read Committed Isolation Level
Date: 2004-01-29 18:06:59
Message-ID: 25090.1075399619@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-01-29 18:07:25 Re: Stupid question on Read Committed Isolation Level
Previous Message Jeroen T. Vermeulen 2004-01-29 18:04:04 Re: Stupid question on Read Committed Isolation Level