[Zope] Locking

Tim Cook tim@freepm.org
Wed, 04 Apr 2001 11:11:05 -0500


Ron Baum wrote:
> 
> I am currently working on a project where I would like to give only one person
> at a time the ability to save a record.  For instance if 2 people go to a page
> that can save the same data I would like to Lock out one of the 2.  I can think
> of many ways to actually lock.  My problem is how do I unlock if the person that
> locked the file just clicks the X on the browser window?

Ron,
I have struggled with this issue for some time now and the 'best'
(albeit, not ideal) solution I have come up with is to create
&/or enter a Version as the webform is loaded, call your
manage_changeProperties() so you have written to the object and
lock out other users then make the changes in the webform
manage_changeProperties() again then save the Version.

This is really ugly for an old RDBMS guy, but 'I think' it works.
If anyone sees a problem feel free to jump in.

I tried working with the transaction and locking machinery but it
made my head hurt too much. ;-) 

-- 
Tim Cook, President - FreePM,Inc. 
http://www.FreePM.com Office: (901) 884-4126
ONLINE DEMO: http://www.freepm.org:8080/FreePM