locking tables and records over the web? (OpenInsight Specific)
At 07 SEP 2000 01:22:26PM Dan wrote:
Hello all,
If I have OI application that has AREV tables attached to it and I allow users to access these arev tables over the web-is it necessary to lock and unlock records if a user wishes to write data into these AREV table via a web-browser?
Doesn't OI automatically lock and unlock records?
Thanks in advance!
Dan.
At 08 SEP 2000 04:55AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:
Hmm an interesting question.
All versions of Rev automatically lock records when the write occurs. This is referred to as a group lock. However, say a local user sets a semaphore lock (as in lock filevar, rowid) then reads the row. They'd get the row and have it in memory. If the web user does not then try to lock the row, they'll get the same row as the local user gets. If they then mod it, the last row written will be the definitive row. So one of the users may lose their changes.
You have several choices -
implement optimistic locking (check at write time whether the row has changed since read and if so refuse the write (although this will need to be implemented locally as well as Web based))
implement pessimistic locking (lock and unlock (although if the user then goes to another site the lock will not be unset and you'll have a slight problem))
implement a mix of the above (our SWEB product starts off pessimistic, after a user specified timeout becomes optimistic (kind of like OICGI on prozac).
Regards
World Leaders in all things RevSoft
At 08 SEP 2000 05:14AM Eric Emu wrote:
Owing to caching on the web, and the use of proxies etc., there is no such thing as a lock on the web unless it is implemented as a physical semaphore lock (i.e. a physical file created on the web server for the occasion).
Eric
B507A---------------------------------------- Internet lock error. Please get all Internet users to close their sessions, log out of the Internet, reboot every server on the Internet simultaneously, then restart the application. ===============================================
At 08 SEP 2000 06:48AM [url=http://www.sprezzatura.com" onMouseOver=window.status=Click here to visit our web site?';return(true)]The Sprezzatura Group[/url] wrote:
World Leaders in all things RevSoft
At 08 SEP 2000 02:00PM Richard Hunt wrote:
Geee I just realized the same thing about 2 days ago. Hmmmm…
What I am going to try to do is to allow the user to lock the record normally, and also set a timer.
Now if the user finishes before the timer, then all is ok and the record will be unlocked normally.
If the timer expires before the user is finished… ???? Kinda thinking of releasing the record lock. Then if the user does finish, maybe check for no record lock and if the original record matches the record in the file… if so then lock record, write record, unlock record.
And maybe you can use the timer only if another wants the record too??? somehow?
I did a little kinda survey. It recorded when a user couldn't lock a record due to another user having the record locked. It happened 2 times in a month. That is all! That was on a 16 user system, and I would say that, on the average, 10 users are on the system at the same time.
So I am heading for the inactivity timer to release the record lock if the user fails to finish within the specified time.