hibernate.org

On 2/18/07, Murray Collingwood <[EMAIL PROTECTED]> wrote:
Hi all

Many years ago I wrote a web application that utilitised a proprietary database.
 The database supported record locking however it was not suitable for a web
application.  So, I wrote a facility I called 'Long Locks'.  It required a
timestamp field be added to each table.  When a web user wanted to edit a record
they would check if the timestamp field was null, if so they wrote a timestamp
into the record and sent this along with the data to the user (the timestamp was
not visible by the user).  After they had completed updating the details (which
could take upto 20 minutes) they could then save the record, the timestamp would
be compared with the entry on the record and if they matched the update would be
committed.

This enabled a number of key features:

1. I was able to guarantee write access for a user when they requested a record
for update.  (If the record was already long-locked I would inform the user the
record was locked by another user).

2. I was always able to read the record

3. If a user abandoned a long-locked record the lock would eventually expire (we
set this to 20 minutes for our application)

I have been reading through a number of record-locking strategies but it seems
most of them are optimistic in that they hope nobody else has updated the record
since it was read, and in the event that it was all of your changes are lost.
This is very frustrating for the user has just spent 20 minutes entering data!

I'm happy to write my own locking system again.  I was just wondering if anybody
knew of a better way - something to save me writing my own system again?

Cheers
mc



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to