Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / General DB Topics / DB Theory / July 2008

Tip: Looking for answers? Try searching our database.

A transaction question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christoph Rupp - 23 Jul 2008 08:42 GMT
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
David BL - 23 Jul 2008 10:11 GMT
> Hi,
>
[quoted text clipped - 18 lines]
> Thanks for your answers,
> Christoph

I think MVCC is normally (only) aimed at allowing for better
concurrency between readers and writers (and not amongst writers) and
therefore is inapplicable in this example.  ie the transactions would
necessarily be serialised.
Bob Badour - 23 Jul 2008 13:57 GMT
> Hi,
>
[quoted text clipped - 18 lines]
> 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) |
Christoph Rupp - 23 Jul 2008 14:47 GMT
Thanks David, thanks Bob for the helpful answers.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.