Unlocking via Application.dispatchRequest()

John Pollard <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Can anyone pick fault in this Editing Context locking scheme, which is 
based on the fact that we want to lock just one EC (which may vary) per 
request that comes in:

When an EC is first created in a thread, or an existing EC first accessed 
for use, lock it and record the fact somewhere in Application, keyed on 
Thread.currentThread()

Wrap the content of Application.dispatchRequest in a try...finally and in 
the finally, check if the currentThread has locked an EC and if so unlock.

This seems to have the advantage of being able to apply the lock in just 
the bit of code used to create ECs or to access existing ones and even 
better, to always do the unlock in just one place. I don't need to worry if 
it was a DA request, whether a Session exists etc.

I enforce only one lock call, so only one unlock call is needed.

Thanks for any advice.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.