Re: Passing variable from DirectAction to Session constructor
Re: Passing variable from DirectAction to Session constructor
- Subject: Re: Passing variable from DirectAction to Session constructor
- From: Mike Schrag <email@hidden>
- Date: Mon, 20 Apr 2009 12:39:15 -0400
In a normal app everyone shares the same OSC ... This is why you have
to lock. If you're locking properly, I can think of any reason why
this would be a problem.
ms
On Apr 20, 2009, at 6:44 AM, Cheong Hee (Gmail-P) wrote:
Apologize for getting back late as some implications happened on my
tests.
Thanks to Chuck's reply. So far using
createSessionForRequest(WORequest aRequest) in Application and
create new OSC seemed working fine. (Not in Wonder yet.) One issue
to find out is - if it is a good idea to have an static array in
Application to keep a pool of OSCs created by different
organizations. By doing this, this is to ensure the users from same
organization will get back its own OSC. Anyone has tried that and
seen side-effect if the user access respective OSCs (and set
defaultEC) in multi-application instances mode?
Cheers
Cheong Hee
----- Original Message ----- From: "Chuck Hill" <email@hidden
>
To: "Cheong Hee (Gmail-P)" <email@hidden>
Cc: <email@hidden>
Sent: Wednesday, April 08, 2009 1:33 AM
Subject: Re: Passing variable from DirectAction to Session constructor
On Apr 6, 2009, at 9:18 PM, Cheong Hee (Gmail-P) wrote:
Dear all
I would like to pass in a value e.g. organization name from
DirectAction to Session constructor. It allows me to look at the
organization name and decide if a new ObjectStoreCoordinator to
be created and setDefaultEditingContext accordingly during
session construction stage. This is taking Chuck's suggestion to
create one OSC per organization name, rather than create new OSC
per session. How is the value be passed into Session constructor
from DirectAction? I have figured hard and must have overlooked
something. Appreciate any pointers.
ERXThreadStorage from Wonder is one way to pass in the parameter.
You could also override public WOSession
createSessionForRequest(WORequest aRequest) in Application and set
the default EC after session creation.
Also, since session().setDefaultEditingContext is not allowed to
set to another EC after it is being called, is there any way to
force it through if so required.
Make sure that you call setDefaultEdtiingContext _before_ you ever
all defaultEditingContext.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve
specific problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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
_______________________________________________
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