[Info-vax] OT: Record locking for web transactions
Neil Rieck
n.rieck at sympatico.ca
Wed Feb 19 20:22:10 EST 2014
On Monday, February 17, 2014 3:13:17 PM UTC-5, JF Mezei wrote:
> With RMS, things were simple. the process running the UI also had the
>
> record locks. If process dies, any/all locks are released.
>
>
>
> How does one handle this with web transactions ?
>
>
>
> Say use pull up a record to update it. When you read the record, you put
>
> a write lock on it to prevent others from modifying it while the first
>
> user does. In normal circumstances, the user press "Submit" and the
>
> record is updated and the lock is released.
>
>
>
> However, there is no garantee the use will press Submit, and the user
>
> could very well close that web page, turn off his PC etc.
>
>
>
> So what sort of strategy is used to handle locks taken by a user who
>
> disapears without warning and never completes the transaction ?
>
>
>
> (this in a context of an app written in PHP accessing MySQL, but looking
>
> for generic strategy to handle this).
I think you should read this article first.
http://en.wikipedia.org/wiki/Optimistic_locking
You would think that something "like an RMS lock might" exist for databases over the web, but you would be wrong.
(and yet, internet banking works so you know that software workarounds exist)
Neil Rieck
Kitchener / Waterloo / Cambridge,
Ontario, Canada.
http://www3.sympatico.ca/n.rieck/
More information about the Info-vax
mailing list