Re: Unable to release locks when using MultiECLockManager
Re: Unable to release locks when using MultiECLockManager
- Subject: Re: Unable to release locks when using MultiECLockManager
- From: Art Isbell <email@hidden>
- Date: Tue, 29 Apr 2008 14:56:42 -1000
On Apr 29, 2008, at 2:24 PM, Owen McKerrow wrote:
Sorry all, I should have specified that further. Has anyone seen it
whilst using MultiECLockManager ?
No, but you must use MultiECLockManager correctly. Are you invoking
MultiECLockManager.unlock() in Session.sleep() before any statement
that might throw an exception that would result in
MultiECLockManager.unlock() not being invoked?
I let MultiECLockManager handle the locking/unlocking of all editing
contexts that aren't WOSession's defaultEditingContext() and that
aren't stored in a local variable (i.e., the scope editing context is
limited to the method in which it is created). I lock/unlock local
editing contexts myself ensuring that they're unlocked:
EOEditingContext ec = new EOEditingContext();
ec.lock();
try {
// Do stuff
}
finally {
ec.unlock();
}
This approach hasn't resulted in any illegal lock usage exceptions.
Aloha,
Art
_______________________________________________
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