From: Lachlan D. <lac...@gm...> - 2007-11-11 19:25:48
|
On 12/11/2007, at 6:08 AM, Miguel Arroz wrote: > I'm migrating my contexts to ERXEC. I was looking at the code to > understand some stuff, and my reading it and reading some emails I > found on the lists, I got a little confused about how granular is the > ERXEC locking. > > I'm currently using the MultiECLockManager, that locks all my > contexts on the session awake and unlocks them on the session sleep. > > From what I understood, this is not what happens in ERXEC. It > looks like to lock/unlock on every operation. Like, if I access > myObject().myField(), it locks immediately before that and unlocks > immediately after that. > > Is this true? If so, is there a way to lock/unlock on the > session's awake/sleep methods? I have a lot of code written with the > assumption that all the contexts are locked during the RR requests, > changing this now would increase the stress levels in my body a lot > more than then usually are. Suggested path is... extend ERXApplication extend ERXSession use ERXEC.newEditingContext() Properties: er.extensions.ERXApplication.useEditingContextUnlocker=true er.extensions.ERXEC.defaultAutomaticLockUnlock=true er.extensions.ERXEC.useSharedEditingContext=false er.extensions.ERXEC.defaultCoalesceAutoLocks=true I believe the defaultCoalesceAutoLocks uses the giant lock approach essentially locking/unlocking per request/response loop. Thus it can be used for non-session based ecs also. with regards, -- Lachlan Deck |