Re: Threads, was Re: Why doesn't this rule work?
Re: Threads, was Re: Why doesn't this rule work?
- Subject: Re: Threads, was Re: Why doesn't this rule work?
- From: Chuck Hill <email@hidden>
- Date: Tue, 12 Oct 2010 19:31:16 -0700
I confess to having no idea what you are trying to model below. The connection between one session and one thread lasts for the duration of one request from the browser and its response from the WO app. The next request for that session can be handled by that same thread (unlikely but possible) or by any other WOWorkerThread. Sessions are not related to threads in any way. The link you perceive from ERXThreadStorage is artificial and temporary.
Chuck
On Oct 12, 2010, at 6:58 PM, Richard Palmer wrote:
> main thread
> |
> -----------------------------------------------
> :| | |
> | | |
> session- thread A session - thread B session - thread C
> / | \ / | \ / | \
> / | \ / | \ / | \
> D E F G H I J K L
>
>
> I guess what I am asking is can I count on threads(D,E,F) always pointing to the session in thread A, threads (G,H,I) always pointing to the session in thread b, and threads(G,H,I) always pointing to the session in thread C.
>
> Richard Palmer
>
>
> On Oct 12, 2010, at 7:36 PM, Chuck Hill wrote:
>
>> The values stashed (which is more accurate than cached) in thread storage are only valid during a single R-R loop. The session is attached to the thread at the start of the RR loop and detached at the end. So the session is the correct place to store your values.
>>
>> Chuck
>>
>>
>> On Oct 12, 2010, at 5:26 PM, Richard Palmer wrote:
>>
>>> Thanks, Ramsey, for the help.
>>>
>>> Delayed key value assignment sets the key correctly (with some changes), but the relationship shows as unset. I am not sure how that works. Perhaps, the relationship is not getting set early enough.
>>>
>>>
>>> I am trying to squirrel things away in the session for later initialization of eos. I tried putting my cached values in ERXThreadStorage, but the eo for initialization ended up being in a different thread from the cached value.
>>>
>>> ERXThreadStorage has a reference to session and using this, I was able to get my cached value out of session.
>>> I cranked up 3 different sessions under Eclipse and they all resolved correctly.
>>>
>>>
>>> Am I kidding myself? Is this going to break in production or are the session objects returned in related (whatever that means) threads correct?
>>>
>>> I hope this post isn't too convoluted. Threads are twisty!
>>>
>>> Richard Palmer
>>>
>>> On Oct 12, 2010, at 5:59 AM, Ramsey Lee Gurley wrote:
>>>
>>>> Wrong assignment class. You need a key value assignment. Although, I don't know if that will actually work either. You have to at least request that value from the context for it to assign it to the key... but it might just assign that to the string key. If you are trying to provide initial values, you may want to look at ERXEntityClassDescription javadocs or set it up in the init() method on your entity class.
>>>>
>>>> Ramsey
>>>>
>>>> On Oct 11, 2010, at 11:31 PM, Richard Palmer wrote:
>>>>
>>>>> I have two entities,
>>>>> Activity <<----------------> Customer
>>>>>
>>>>> Why doesn't this rule set a Customer in Activity?
>>>>>
>>>>> 200 : (task = 'edit' and entity.name = 'Activity' and tabKey = 'Customer') => object.toCustomer = session.customerFocus [com.webobjects.directtoweb.EntityAssignment],
>>>>>
>>>>>
>>>>> session.customerFocus() is a method returning a customer stored in session. This is in a ERMODWizardCreationPage whose first Tab Section is 'Customer'.
>>>>>
>>>>> Richard Palmer _______________________________________________
>>>>> 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
>>
>> --
>> 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
--
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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