Jump to content

Thomas write rule seems to ignore the Write on a data item of a transaction, how is that even legal to do?


Go to solution Solved by gizmola,

Recommended Posts

image.thumb.png.0e260c284ea59aad05f407ae48b4c55c.png

http://www.csc.villanova.edu/~enwafor/database/lectures/Lecture_14_concurrency.pdf

Slides taken from here.

Transaction could be a banking transaction. If I am ignoring a write of an operation and continuing forwards, would not that hamper the transaction? I am pretty confused.

  • Solution

These models describe how the relational database engine handles concurrency.  You don't DO anything.  The Database does things for you, using various algorithms and whatever concurrency model you've configured it to use.  These differ from RDBMS to RDBMS.

This particular optimization is intended to deal with the processing of timestamped transactions in a transaction log that is being used to actually write out data.   

So by definition, this involves multiple "user/connections" that are trying to operate on the same row of data at close to/near the same time so that the transaction log is likely to have these read/write pairs of operations that could end up being in conflict with each other , and those scenarios are specific to an application and typically few/far between.  

In your case, for a banking transaction where you might need to debit/credit, you would wrap the changes inside a transaction, perhaps having issued a SELECT FOR UPDATE if the transaction would be updating a balance field.  

I'm not sure what the value of focusing on Minutiae like this provides, without any practical application or testing on your part.  To examine how this all works, and what ramifications it would have, you would need to:

  • Have a database that implements the Thomas's write rule
  • Set up a database/tables
  • Simulate the different scenarios (which is non-trivial as these would need to be separate sessions)

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.