Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Lock tables

Quote Reply
Re: Lock tables In reply to
I guess I mis-read the question.

There is "record level" locking, meaning no two people can modify the same link at the same time, and more than 1 person can make changes to the database at one time.

I guess I read it as:

If Jane does a search to modify 10 records with a keyword of "Grass", which includes (for example) Link ID #222, and then Roger does a search to modify record #222 there is no way for the database to keep track of that.

The two changes can overwrite each other.

Example -- Jane's request is at 2:30 and Roger's is at 2:31 Both get the same copy of the record.

Roger saves his change back to the database at 2:32, but jane, who is modifying 10 records, takes 10 minutes to make the changes, and she doesn't save the changes back until 2:40. Her changes of record 222 will overwrite Rogers, because the Admin made a "select" request, and populated a form, it didn't put a "hold" or a "lock" on the records that were being returned.

When the "update" button is pressed, the form sends an "update" request to the database, but it assumes that any data in the new fiels overwrites the old data, so no check is made that the data has not changed since it was last accessed.

You could get around this using a "timestamp" variable, or a "datetime" variable that is updated whenever the record is modified.

If the hits are _not_ being written to the main Links table, a plain "timestamp" field would work... if they are, you'd have to define a new field such as "admin_edit" as a "datetime" and update it with the time the update was made. You'd need to check for that BEFORE updating the record, and if it's later than the one you have, you need a way to save the new edits, show the changes, and let them be overridden or not. It's really, really, really bad form and incredibly aggrevating to find all the changes you made thrown away and lost because the database updated the hits/ratings values and you've made significant changes to the Descriptions.

That's what I visualized by "lock" as opposed to multi-user access.

I could be wrong in the above -- but I've been able to make simultaneous changes to the database from different browser windows, without any "record locked" messages, so I'm assuming that what I see in the code (and explain above) is how it works.

Subject Author Views Date
Thread Lock tables Lepo75 26091 Mar 16, 2000, 12:33 PM
Post Re: Lock tables
pugdog 25350 Mar 16, 2000, 8:55 PM
Post Re: Lock tables
Alex 25356 Mar 17, 2000, 2:54 PM
Post Re: Lock tables
pugdog 25349 Mar 17, 2000, 6:30 PM
Thread Re: Lock tables
Alex 25389 Mar 18, 2000, 8:17 AM
Post Re: [Alex] Lock tables
chico 25239 Sep 25, 2007, 3:01 PM
Post Re: Lock tables
pugdog 25347 Mar 18, 2000, 2:59 PM