• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using ERXThreadStorage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using ERXThreadStorage


  • Subject: Re: Using ERXThreadStorage
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 16 Dec 2015 15:18:39 +0000
  • Thread-topic: Using ERXThreadStorage

The contents of the thread storage are removed at the end of each R-R loop to prevent data leaking between requests (and to prevent memory leaks too).

Wonder already puts the session in thread storage under “session” so you could just use that and ask it for the region in your EOs.


Chuck


From: <webobjects-dev-bounces+chill=email@hidden> on behalf of Benjamin Steiner <email@hidden>
Date: Wednesday, December 16, 2015 at 1:07 AM
To: WebObjects-Dev <email@hidden>
Subject: Using ERXThreadStorage

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

References: 
 >Using ERXThreadStorage (From: Benjamin Steiner <email@hidden>)

  • Prev by Date: Re: Using ERXThreadStorage
  • Next by Date: ERRest response header and encoding
  • Previous by thread: Re: Using ERXThreadStorage
  • Next by thread: ERRest response header and encoding
  • Index(es):
    • Date
    • Thread