From: Kieran K. <kie...@ma...> - 2008-12-03 21:26:15
|
Whether I use ERXEC or not, I always lock, try and finally unlock, however I have only ever turned on the useUnlocker in the past as a safety net. Looking at the defaults for a new Wonder project, we have: er.extensions.ERXEC.safeLocking=true The source shows that this in turn enables on the following: defaultAutomaticLockUnlock defaultCoalesceAutoLocks useUnlocker Looking at the source, my understanding of above settings is that a new ERXEC is locked the first time it is used and unlocked at the end of a request by ERXApplication or at the end of ERXLongResponse. So I have some clarification questions: 1) So the above basically means you *could* forget about locking completely and not even think about it? ........ in both R-R threads and ERXLongResponse background threads?? 2) However, if you have your own Callables/Runnables and you want to take advantage of safeLocking, you need to call ERXEC.unlockAllContextsForCurrentThread() in a finally clause, correct? 3) And besides all that, one can turn on safeLocking and completely ignore that it is there and do your own lock, try, finally unlock anyway and just use it as a safety net for unexpected conditions .... is that right? -Kieran |