It is not just a get from the underlying store there is a bit of processing
involved with the getSequence and getEndpoint methods for example to fetch
the content from the registry if not found in the SynapseConfiguration and
also initialize the element before returning if that is not initialized sort
of.

Thanks,
Ruwan

On Fri, Sep 11, 2009 at 2:07 AM, George Sanchez <george.sanc...@gmail.com>wrote:

> Ok. got you.
> I thought the issue is with the Axis2MessageContext class getting sequence
> and endpoints.
> The method getSequence and getEndpoint exist in the SynapseConfiguration
> class as well right ?
> Does it store it as well in a HashMap ?
> My point is that if the underlying store/collection that you are using to
> keep the objects (e.g. Vector or Hashtable) are already synchronized then
> you might not need to synchorize the method that gets it from that store as
> the store itself is already synchronized.
>
> Just an idea.
>
> On 9/10/09, Ruwan Linton <ruwan.lin...@gmail.com> wrote:
>>
>> Hi George,
>>
>> The issue is not about, the localEntries variable, but the
>> SynapseConfiguration#getSequence and getEndpoint, the problem in hand cannot
>> be fixed by making the localEntries variable type into a HashTable.
>>
>> Thanks,
>> Ruwan
>>
>> On Thu, Sep 10, 2009 at 9:18 AM, George Sanchez <george.sanc...@gmail.com
>> > wrote:
>>
>>> Hi Hiranya,
>>>      If you will change the localEntries variable from HashMap to a
>>> Hashtable for storing endpoints and sequences everything will be ok because
>>> Hashtables are synchronized. You don't have to synchronize the methods.
>>>      i don't think that it there will be anything really significant
>>> performance impact if you use a Hashtable.
>>>
>>> Regards,
>>> George Sanchez
>>>
>>>
>>>  On Wed, Sep 9, 2009 at 7:48 AM, Hiranya Jayathilaka <
>>> hiranya...@gmail.com> wrote:
>>>
>>>
>>>> Hi Devs,
>>>>
>>>> The Axis2MessageContext class uses SynapseConfiguration#getEndpoint and
>>>> SynapseConfiguration#getSequence methods to gain access to dynamic 
>>>> endpoints
>>>> and sequences when they are not present in the message context's local
>>>> store. However these method calls are not synchronized and from the looks 
>>>> of
>>>> it I feel that if two message contexts try to access the same dynamic
>>>> resource at the same time there is a chance that SynapseConfiguration would
>>>> perform two remote registry lookups to fetch the same resource. This won't
>>>> really cause any erroneous behavior but if the ESB is under a huge load
>>>> where each message is trying to load a particular dynamic resource things
>>>> may get out of hands.
>>>>
>>>>
>>>> So does it make sense to bring in some synchronization into the picture?
>>>> Or have I missed something and the above theory is not applicable?
>>>>
>>>>
>>>> Thanks
>>>> --
>>>> Hiranya Jayathilaka
>>>> Software Engineer;
>>>> WSO2 Inc.;  http://wso2.org
>>>> E-mail: hira...@wso2.com;  Mobile: +94 77 633 3491
>>>> Blog: http://techfeast-hiranya.blogspot.com
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> George Sanchez
>>>
>>>
>>
>>
>> --
>> Ruwan Linton
>> Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
>> WSO2 Inc.; http://wso2.org
>> email: ru...@wso2.com; cell: +94 77 341 3097
>> blog: http://ruwansblog.blogspot.com
>>
>
>
>
> --
> George Sanchez
>



-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ru...@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Reply via email to