tedd wrote:
Hi gang:
I have *my way* of handling this problem, but I would like to hear
how you guys do it.
Here's the problem -- let's say you have a database containing names
and addresses and you want "approved" users to be able to access the
data. As such, a user must login before accessing an editing script
that would allow them to review and edit the data -- nothing
complicated about that.
However, let's say you have more than one user accessing the editing
script at the same time and you want to make sure that any changes
made to the database are done in the most efficient manner possible.
For example, if two users access the database at the same time and
are editing different records, then there's no real problem. When
each user finishes editing they simply click submit and their changes
are recorded in the database. However, if two (or more) users want to
access the same record, then how do you handle that?
I would provide read access whatever the case. For write access I would
place a lock on the data for the first user to make the edit request.
The lock would have an expiry time, and the user in possession of the
lock could reset it if they need more time. Other users would be alerted
that another user is currently editing the data and that the lock will
expire in X minutes. If the user completes their edit before the timer
expires, then the timer will be automatically cleared upon commit of the
changes. Optionally, the user who doesn't get the lock could be alerted
to what user currently has the lock. Additionally, if we get complicated
we could allow a higher authority to steal the lock and alert the user
making edits.
Cheers,
Rob.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php