synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Sanchez <george.sanc...@gmail.com>
Subject Re: Concurrent Access to Dynamic Resources
Date Thu, 10 Sep 2009 03:48:44 GMT
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 <hiranya911@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: hiranya@wso2.com;  Mobile: +94 77 633 3491
> Blog: http://techfeast-hiranya.blogspot.com
>



-- 
George Sanchez

Mime
View raw message