Using ERXThreadStorage
Using ERXThreadStorage
- Subject: Using ERXThreadStorage
- From: Benjamin Steiner <email@hidden>
- Date: Wed, 16 Dec 2015 10:07:48 +0100
Hi list,
In our application, we keep the business-logic with the EO-model in a separate framework. Because some of the enterprise objects are region-specific, we need to get access to the logged in user(or its region, respectively) with a static method. The problem is that the user is stored in the session, so we can’t access it from the business-framework.
We tried to use ERXThreadStorage, but we only get NULL out of it when we try to get the region. Is there something we overlooked? Here’s the code we use to store and retrieve the region:
(this happens in the constructor of the session, wenn the user logs in) ERXThreadStorage.takeValueForKey( region, ERXThreadStorageKeys.CURRENT_REGION );
(this happens on an EO in the business-framework) Region region = (Region)ERXThreadStorage.valueForKey( ERXThreadStorageKeys.CURRENT_REGION );
Thanks, Beni |
_______________________________________________
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