Keith Kwiatek wrote:
>
> Hello,
>
> In a CGI type of web environment, user "A" wants to update a certain row of
> data, so he fetches it for display in his browser. User "B" fetches the same
> data shortly after user "A" fetches the data (but before user "A" updates).
> User "A" updates. Then user "B" updates, resulting in user "B" overwriting
> the update of user "A", but never seeing user "A" updates. This is because
> in a typical web environment, the database connection is closed (OR randomly
> pooled) with each http request, thus not taking advantage of oracles
> "A.C.I.D." transaction qualities (if you need to ask, then you are not
> qualified to answer)....
>
> Does anyone have any experience with this?
>
You can have a timestamp field. In some databases this is automatically
managed ( mysql) , but you can always make triggers.
Before storing data, check if the timestamp changed
and warn the user.
Another solution is build yourself a soft locking system.
Have a table of locks like this: Table , id , timeout.
When timeout is reached the register is no longer locked.
This is not perfect but can help.
--
- frankie -