Re: editing context locking
Re: editing context locking
- Subject: Re: editing context locking
- From: Kaj Hejer <email@hidden>
- Date: Wed, 6 Apr 2005 21:06:06 +0200
On 6. apr 2005, at 20.45, Florijan Stamenkovic wrote:
When I am creating new objects within a completely new editing context
(nested into the default one) do I _need_ to lock???
Yes! You should always lock any ec you create yourself. The only ec you
don't need to lock is session.defaultEditingContext.
The best thing is to lock the ec just after it is created. You can
unlock f.x. in sleep in the component (or some other place :)
You might want to take a look at MultiECLockManager, see
<http://www.wocode.com/WOCode/Files/MultiECLockManager.java>
To dedect access to any ec that is not lock (as it should be! :) add
the following lines to the constructor in your Application.java:
NSLog.debug.setAllowedDebugLevel(NSLog.DebugLevelInformational);
NSLog.allowDebugLoggingForGroups(NSLog.DebugGroupMultithreading);
setAllowsConcurrentRequestHandling(true);
You find a good guide to the art of locking editingcontexts in the book
"Practical WebObjects", see
<http://www.global-village.net/products/practical_webobjects>.
-Kaj :)
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden