Re: WOLongResponesePage Problem
Re: WOLongResponesePage Problem
- Subject: Re: WOLongResponesePage Problem
- From: "Tonny Staunsbrink" <email@hidden>
- Date: Sat, 24 May 2008 23:09:47 +0200
On Thu, May 22, 2008 at 3:16 AM, Lachlan Deck <
email@hidden> wrote:
On 21/05/2008, at 8:11 PM, Patrick Middleton wrote:
On 21 May 2008, at 10:59, santoshg wrote:
I am using WOLongResponsePage Component in my project.
But in the run time, it is showing the error message:
Session.context() evaluates to null. You may be trying to get the context object
from an archived session object. there is no context object outside of the
request-response loop.
The component is unable to generate response.
I would like to know how to access the Session context in WOLongResponsePage performAction() method.
Please help in solving the above situation, if possible with some code snippet.
Thanks and Regards,
gsk.
You can't, and you shouldn't try.
A request is received and processed and a response is generated, and this all happens in one thread, and it needs to be quick. While this is happening you have access to the Session and the WOContext in that thread.
What you need to do is get all the properties you need from the Session or WOContext before you start the thread that does the long response thing, and store them in instance variables in your component, so that when the secondary thread is running it can use those instead.
Also bear in mind that accessing the session's editing context within the performAction thread is a sure path to deadlocks.
Using the sessions editingContext in a background thread with proper locking/unlocking should be ok I think.
Cheers
Tonny
with regards,
--
Lachlan Deck
_______________________________________________
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
mezz.dk@
gmail.com
_______________________________________________
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