Hi Shankar,

Well I'm not too sure about that, which I did not quite realize, but it
could possibly be that the existence was tested before and the result of is
exiting was cached but the content was not causing the get to fail, since
the actual resource and it's existence is cached in a two step process,
solely for performance. But, it also could be a bug, which only debugging
can reveal, which I'm not sure. But if this gets corrected with proper
caching in place I'd rather expect it to be former rather than the latter.

Thanks,
Senaka.

On Wednesday, February 1, 2012, Selvaratnam Uthaiyashankar <shan...@wso2.com>
wrote:
> On Wed, Feb 1, 2012 at 2:34 AM, Senaka Fernando <sen...@wso2.com> wrote:
>> Hi Shankar,
>>
>> I believe that we got the wrong impression out of this discussion. What I
>> initially suggested is that Pradeeban check whether caching is properly
>> setup.
>>
>> If no distributed/replicated caching is available, the result is cached
>> locally in each node (the two nodes don't communicate with each other),
and
>> even if you delete from the one side the other side will not know that
since
>> the caches are not replicated (and the second node won't invalidate its
copy
>> due to this reason). The second node will realize that the resource is
gone
>> only when the cache timesouts.
>
> I agree with your above comment. But the question was why
> ResourceNotFoundException thrown when resourceExists() is true. If a
> resource is cached locally in one node, will
> configRegistry.resourceExists(serviceResourcePath) return true and
> resource = configRegistry.get(serviceResourcePath) throw exception?
> cache invalidation can't be the issue, because in the code Pradeeban
> shared, when the exception is thrown, he is again doing a test of
> configRegistry.resourceExists(serviceResourcePath).
>
>
> Shankar
>
>
>>
>> Thanks,
>> Senaka.
>>
>>
>> On Tue, Jan 31, 2012 at 9:47 AM, Selvaratnam Uthaiyashankar
>> <shan...@wso2.com> wrote:
>>>
>>> Hi Senaka,
>>>
>>> Does that mean, configRegistry.resourceExists(serviceResourcePath)
>>> takes from cache and resource =
>>> configRegistry.get(serviceResourcePath); takes from database? That
>>> doesn't sound right to me. If this is the case, why we are caching
>>> only the path, but not the resource?
>>>
>>> If above two succeed when the resource is not actually in the
>>> database, or above two failed when the resource is in the database,
>>> then it is due to the caching. If one of the above succeed and the
>>> other fails, then we need to fix it.
>>>
>>> Shankar
>>>
>>> On Sun, Jan 29, 2012 at 3:10 PM, Senaka Fernando <sen...@wso2.com>
wrote:
>>> > Hi Dimuthu,
>>> >
>>> > Well that probably explains my point. If you test something across two
>>> > nodes
>>> > you need to turn off caching in registry or properly setup distributed
>>> > or
>>> > replicated caching. If not each node caches locally, and will not sync
>>> > until
>>> > timeout.
>>> >
>>> > Thanks,
>>> > Senaka.
>>> >
>>> >
>>> > On Thursday, January 26, 2012, Dimuthu Leelarathne <dimut...@wso2.com>
>>> > wrote:
>>> >> Hi Senaka,
>>> >>
>>> >> On Thu, Jan 26, 2012 at 5:26 AM, Senaka Fernando <sen...@wso2.com>
>>> >> wrote:
>>> >>>
>>> >>> Hi Pradeeban,
>>> >>>
>>> >>> Probably, due to caching not properly setup.
>>> >>>
>>> >>
>>> >> AFAIK registry reads from database when it is not in the cache. From
my
>>> >> experience Registry worked perfectly when multicasting ports were
>>> >> closed in
>>> >> the switch as well.
>>> >>
>>> >> thanks,
>>> >> dimuthu
>>> >>
>>> >>>
>>> >>> Thanks,
>>> >>> Senaka.
>>> >>>
>>> >>> On Wed, Jan 25, 2012 at 11:39 PM, Kathiravelu Pradeeban
>>> >>> <pradee...@wso2.com> wrote:
>>> >>>
>>> >>> The deployment was with the SVN based deployment synchronizer. Ghost
>>> >>> deployer is disabled.
>>> >>>
>>> >>> Regards,
>>> >>> Pradeeban.
>>> >>>
>>> >>> On Wed, Jan 25, 2012 at 7:43 PM, Kathiravelu Pradeeban
>>> >>> <pradee...@wso2.com> wrote:
>>> >>>
>>> >>> Hi,
>>> >>> Azeez and I were testing a Stratos deployment with 2 nodes of
>>> >>> Appserver.
>>> >>> We did a minor modification in the getService() of
>>> >>> ServicePersistenceManager
>>> >>> as below.
>>> >>>
>>> >>> Then we uploaded a service; accessed it from two browsers; and
deleted
>>> >>> it.
>>> >>> Interestingly the highlighted code-segment is executed, and prints
>>> >>> true,
>>> >>> in the terminal of the other node.
>>> >>>
>>> >>> That means, the resourceExists, but the ResourceNotFoundException is
>>> >>> thrown. Can someone explains this behavior?
>>> >>>
>>> >>>
>>> >>>     public Resource getService(AxisService axisService) throws
>>> >>> Exception
>>> >>> {
>>> >>>         try {
>>> >>>             String serviceResourcePath =
>>> >>> PersistenceUtils.getResourcePath(axisService);<

-- 
*Senaka Fernando*
Product Manager - WSO2 Governance Registry;
Associate Technical Lead; WSO2 Inc.; http://wso2.com*
Member; Apache Software Foundation; http://apache.org

E-mail: senaka AT wso2.com
**P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818
Linked-In: http://linkedin.com/in/senakafernando

*Lean . Enterprise . Middleware
_______________________________________________
Carbon-dev mailing list
Carbon-dev@wso2.org
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to