Re: A transaction question

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Wed, 23 Jul 2008 09:57:13 -0300
Message-ID: <48872ab1$0$4056$9a566e8b@news.aliant.net>


Christoph Rupp wrote:

> Hi,
>
> i have a question about two parallel transactions which insert the
> same key.
>
> Assume that key A does not yet exist.
>
> T1 Begin
> T2 Begin
> T1 Insert A
> T2 Insert A
> T1 Commit
> T2 Commit
>
> My guess is: "T2 Insert A" is a conflict with the previous insert of
> T1. But i also think that in a MVCC database the conflict can only be
> resolved when T2 is committed. What happens then? Does the commit
> fail, or is A silently overwritten? Or is the typical behaviour in
> this case implementation-specific?
>
> Thanks for your answers,
> Christoph

Even in MVCC, T2's Insert A will block until after T1 Commit.

| T1 | T2 |


| Begin  |        |
|        | Begin  |
| Ins A  |        |
|        | Ins A  |
|        | (block)|
| Commit | (fail) |
Received on Wed Jul 23 2008 - 07:57:13 CDT

Original text of this message