Re: Application terminates when a session times out
Re: Application terminates when a session times out
- Subject: Re: Application terminates when a session times out
- From: Seejo Pylappan <email@hidden>
- Date: Fri, 14 Feb 2003 17:21:32 -0500
On Friday, February 14, 2003, at 05:10 PM, meena wrote:
Are you fetching it in a session and then setting it as a
universal user?
Yes, this is exactly what I am doing. After fetching the IA_User
object
in the session's defaultEditingContext, I am storing this object at the
Application level.
There thats the problem. The session timeout will finalize the
editingcontext which is the one needed by your IA_User.
a. How can I initialize such application objects if it should not
done be
through a session ?
b. Is there a way to physically copy such objects from the session to
the
application level so that it is available even after the session is
terminated ?
You can either do the fetch in the Application after creating a new
editingContext:
private EOEditingContext applicationEditingContext = new
EOEditingContext();
and using this in your Application.java initializer to fetch.
If you have to want to wait till your first session is created in the
app to get the IA_User then you can create the editingContext in the
Application.java like above and then when you set the EO from the
session in the Application you can make a local instance of the EO in
the Application's editingContext with:
IA_User aUser =
applicationEditingContext.localInstanceOfObject(sessionIAUser);
this will create a EO using your Application's editingContext.
-Seejo
Thanks in advance,
Meena.
Seejo Pylappan wrote:
Check the code segment in : Session.isAnIAEmployee. That seems to be
where the problem is comming from. where are you getting the IA_User
from? Are you fetching it in a session and then setting it as a
universal user? in other words what is happening is the
EOEditingContext in which the IA_User is fetched has been finalized
when your session times out (check finalize code?) and then when you
reenter, you are messaging to the IA_User whose editingContext is no
longer around and is causing the crash.
On Thursday, February 13, 2003, at 11:14 AM, meena wrote:
Hello all,
I have moved my WebObjects 4.5 application to WebObjects 5.1.4 on
Mac
OS X 10.2.3. I have successfully compiled the application and even
could execute the application with no problems. But, there is a
problem when my session times out. I have set a time out in my
session for 12minutes. Also, I have found that once a session is
timed out, the application gets terminated at the next request by
either other sessions or when I try to establish a new session. Do I
need to explicitily do some settings ? I don't remember doing one
such when I used WebObjects 4.5. I feel that when one session
times out, it times out the rest of the sessions or and somehow fails
when there is a new request to the application.
In my Session.java, I have the following
public Session () {
super();
this.setTimeOut(12*60); // Shut down if idle for 12minutes.
}
I have the following piece of code is present in my Application.java
/* The following method is invoked when the application receives
a
request from a session that has timed out. */
public WOResponse
handleSessionRestorationErrorInContext(WOContext
aContext) {
WOComponent nextPage;
nextPage = this.pageWithName("Main", aContext);
return nextPage.generateResponse();
}
When the session times out, and I click on a link on the page which
was linked to timed out session, I expect the system to display the
Home page ("Main"), rather the application is terminated. I get the
following error. This application is really working very well with
WebObjects 4.5 (both development and deployment environment), but
currently this problem occurs with WebObjects 5.1.4. Development
environment. I never thought that such a serious problem would
arise when I move to a higher version. I really appreciate any
suggestions/help in this matter.
Meena.
****************************************
[2003-02-13 15:45:17 CET] <WorkerThread10> <WOApplication 'LAWeb'>:
Exception occurred while handling request:
com.webobjects.foundation.NSForwardException
[java.lang.IllegalStateException] null
[2003-02-13 15:45:17 CET] <WorkerThread10>
com.webobjects.foundation.NSForwardException for
java.lang.IllegalStateException: attempt to send message to object of
class class IA_User after its EOEditingContext was finalized
at
com.webobjects.eocontrol.EOEditingContext$_EOInvalidationFaultHandler
.c
ompleteInitializationOfObject(EOEditingContext.java:165)
at
com.webobjects.eocontrol.EOCustomObject.willRead(EOCustomObject.java:
83
2)
at
com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_Ge
ne
ricRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:492)
at
com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObj
ec
t.java:1174)
at IA_User.user_Id(IA_User.java:136)
at Session.isAnIAEmployee(Session.java:134)
at Main.<init>(Main.java:66)
at java.lang.reflect.Constructor.newInstance(Native Method)
at
com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities
.j
ava:526)
at
com.webobjects.appserver._private.WOComponentDefinition._componentIns
ta
nceInContext(WOComponentDefinition.java:470)
at
com.webobjects.appserver._private.WOComponentDefinition.componentInst
an
ceInContext(WOComponentDefinition.java:576)
at
com.webobjects.appserver.WOApplication.pageWithName(WOApplication.jav
a:
1738)
at
Application.handleSessionRestorationErrorInContext(Application.java:1
87
)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispatch
Wi
thPreparedApplication(WOComponentRequestHandler.java:308)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleRe
qu
est(WOComponentRequestHandler.java:346)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleReq
ue
st(WOComponentRequestHandler.java:414)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.
ja
va:1133)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThre
ad
.java:158)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.j
av
a:231)
at java.lang.Thread.run(Thread.java:491)
[2003-02-13 15:45:17 CET] <WorkerThread10> <WOWorkerThread id=10
socket=Socket[addr=iamac49.epfl.ch/
128.178.5.78,port=49538,localport=51746]> Exception occurred while
responding to client: java.lang.NullPointerException
[2003-02-13 15:45:17 CET] <WorkerThread10>
java.lang.NullPointerException
at Application.handleException(Application.java:167)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handleRe
qu
est(WOComponentRequestHandler.java:366)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleReq
ue
st(WOComponentRequestHandler.java:414)
at
com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.
ja
va:1133)
at
com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThre
ad
.java:158)
at
com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.j
av
a:231)
at java.lang.Thread.run(Thread.java:491)
****************************************
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.