I need to do some sort of Locking mechanism at interface level, instead of DB Level.
I know how MySQL table locking works, but that won't work in my scenerio.
Requirements:
When someone is editing a case, for example changing the persons info, editing the violations/charges they have, etc... I don't want another user to have pulled the same case and one of them clicks Update or Save before the other.
So the case is locked for editing and should only be changed by that user.
My Proposed Solution:
Upon entering the case editing page, I could issue a table lock on ALL the tables for Write (there are several) and unlock it when the person leaves, closes the case and goes back to the list or elsewhere.
What happens if that user closes the browser or their computer turns off?
First of all when anybody else trying to access it, it will show what user is editing it. (Don't know where i should this save this info? another table? I already have way too many)
The same person that locked it however, should be able to go back in and finish and close, and hence Unlock it at that time.
If that person is no longer available (went home), admins can go in and unlock it by force so other users now can go in.
I could also set a timer? or check to see if its been an hour since that person locked it and allow if it is. No admin interaction needed with this.
And maybe even use my current Ajax functions to update the DB while that person is in the case editing page. So essentially a person can be in there for an hour (It's a big page)
I guess my original statement where locking tables won't do should be changed to, locking tables can do that, is there any other way in this unforsaking state-less web.
Your Ideas:
[Insert Here]
I'm not looking for code, but any other ideas, solutions or ways of doing this. I know this is a long shot in the dark and don't expect pbmods to show up out of mystical light in the sky http://www.cosmiclighthouse.com/file...feb08/tree.jpg
But you never know :) you numbnuts might know a thing or two.
Thanks for all your input guys,
Dan
I know how MySQL table locking works, but that won't work in my scenerio.
Requirements:
When someone is editing a case, for example changing the persons info, editing the violations/charges they have, etc... I don't want another user to have pulled the same case and one of them clicks Update or Save before the other.
So the case is locked for editing and should only be changed by that user.
My Proposed Solution:
Upon entering the case editing page, I could issue a table lock on ALL the tables for Write (there are several) and unlock it when the person leaves, closes the case and goes back to the list or elsewhere.
What happens if that user closes the browser or their computer turns off?
First of all when anybody else trying to access it, it will show what user is editing it. (Don't know where i should this save this info? another table? I already have way too many)
The same person that locked it however, should be able to go back in and finish and close, and hence Unlock it at that time.
If that person is no longer available (went home), admins can go in and unlock it by force so other users now can go in.
I could also set a timer? or check to see if its been an hour since that person locked it and allow if it is. No admin interaction needed with this.
And maybe even use my current Ajax functions to update the DB while that person is in the case editing page. So essentially a person can be in there for an hour (It's a big page)
I guess my original statement where locking tables won't do should be changed to, locking tables can do that, is there any other way in this unforsaking state-less web.
Your Ideas:
[Insert Here]
I'm not looking for code, but any other ideas, solutions or ways of doing this. I know this is a long shot in the dark and don't expect pbmods to show up out of mystical light in the sky http://www.cosmiclighthouse.com/file...feb08/tree.jpg
But you never know :) you numbnuts might know a thing or two.
Thanks for all your input guys,
Dan
Comment