Re: Lock/Unlock problem with logout
Re: Lock/Unlock problem with logout
- Subject: Re: Lock/Unlock problem with logout
- From: Jacky Gagnon <email@hidden>
- Date: Mon, 25 Apr 2005 11:03:31 -0400
Hi Marc-Alexis,
Awake is supposed to be called.
I had the same issue in the past because the session was terminated
when sleep is called.
Just unlock the ecLockManager before calling super.terminate() like
this :
public void terminate()
{
myEcLockManager().unlock();
myEcLockManager = null;
super.terminate();
}
// and check in sleep if the ecLockManager is not null...
public void sleep()
{
if ( myEcLockManager != null )
myEcLockManager().unlock();
super.sleep();
}
Good luck!
Jacky
On 05-04-24, at 12:57, Marc-Alexis Côté wrote:
Hello,
I am supposed to deploy my application tomorrow and while doing some
testing, I stumbled across an annoying bug. Here is what happens:
-An administrative user creates a new "dealer". The dealer object is
inserted into a child editing context that is registered with a
MultiEClockManager. The manager is locked/unlocked in the awake/sleep
methods of the Session. The administrator is then presented with a few
pages
where he fills out the dealer's information. This is the normal
workflow and
it works fine.
-Everything also works fine if he click the cancel button.
-Things start to go wrong if he clicks a logout hyperlink. I get the
following exception:
[2005-04-24 12:48:48 EDT] <WorkerThread0>
java.lang.IllegalStateException:
Illegal Lock usage: unlock() called without a lock().
at
com.webobjects.foundation.NSRecursiveLock.unlock(NSRecursiveLock.java:
210)
at
com.webobjects.eocontrol.EOEditingContext.unlock(EOEditingContext.java:
4660)
at er.extensions.ERXEC.unlock(ERXEC.java:220)
at
com.webobjects.eocontrol.EOEditingContext.unlock(EOEditingContext.java:
4658)
at MultiECLockManager.unlock(MultiECLockManager.java:94)
at Session.sleep(Session.java:52)
at
com.webobjects.appserver.WOSession._sleepInContext(WOSession.java:731)
[...clipped...]
This exception seems to be justified, because I have put trace
statements in
the Session's sleep/awake methods, and awake wasn't called. Is this
normal?
(In other words, sleep seems to have been called without a call to
awake)
After that, I see a call to Session.awake and a trace statement in my
logout
method. Then sleep is called and throws again...
Can anyone give me some thoughts on how to solve this problem?
Marc-Alexis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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