Hi Azeez,

On Wed, Jan 19, 2011 at 12:09 AM, Afkham Azeez <[email protected]> wrote:

>
>
> On Tue, Jan 18, 2011 at 11:14 AM, <[email protected]> wrote:
>
>> Author: miyuru
>> Date: Mon Jan 17 21:44:01 2011
>> New Revision: 85458
>> URL: http://wso2.org/svn/browse/wso2?view=rev&revision=85458
>>
>> Log:
>> set supertenant_id on threadlocal carbon context
>> to fix synapse registry inilialization getting tenant id as -1
>>
>>
>>
>> Modified:
>>
>> trunk/carbon/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/CarbonAxisConfigurator.java
>>
>> Modified:
>> trunk/carbon/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/CarbonAxisConfigurator.java
>> URL:
>> http://wso2.org/svn/browse/wso2/trunk/carbon/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/CarbonAxisConfigurator.java?rev=85458&r1=85457&r2=85458&view=diff
>>
>> ==============================================================================
>> ---
>> trunk/carbon/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/CarbonAxisConfigurator.java
>>       (original)
>> +++
>> trunk/carbon/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/CarbonAxisConfigurator.java
>>       Mon Jan 17 21:44:01 2011
>> @@ -46,6 +46,7 @@
>>  import org.wso2.carbon.utils.deployment.Axis2DeployerRegistry;
>>  import org.wso2.carbon.utils.deployment.Axis2ModuleRegistry;
>>  import
>> org.wso2.carbon.utils.deployment.service.listeners.Axis2ConfigServiceListener;
>> +import org.wso2.carbon.utils.multitenancy.CarbonContextHolder;
>>  import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
>>
>>  import javax.xml.namespace.QName;
>> @@ -254,6 +255,7 @@
>>             carbonContext.setRegistry(RegistryType.LOCAL_REPOSITORY,
>>                     rs.getLocalRepository());
>>
>> carbonContext.setTenantId(MultitenantConstants.SUPER_TENANT_ID);
>> +
>>  
>> CarbonContextHolder.getThreadLocalCarbonContextHolder().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
>>
>
> Senaka, shouldn't  carbonContext.setTenantId already being doing the above
> (the newly added line)?
>

Can't trace how 'carbonContext' was obtained. If this was obtained
specifically from some location (configuration context, message context
etc.) using the SuperTenantCarbonContext class, the thread local instance
wouldn't be affected (this was mainly designed to be used in Authenticators
etc). I believe that Miyuru might be doing that in the code above, and the
code below might be for some tenant-specific initialization work on the
current thread.

Anyway, we need to know the intentions of both portions, as it seems to be a
bit fishy as you point out.

Thanks,
Senaka.

>
>>         } catch (Exception e) {
>>             String msg = "Error occurred while populating the
>> CarbonContext on the " +
>> _______________________________________________
>> Carbon-commits mailing list
>> [email protected]
>> https://wso2.org/cgi-bin/mailman/listinfo/carbon-commits
>>
>
>
>
> --
> *Afkham Azeez*
> Senior Software Architect & Senior Manager; WSO2, Inc.; http://wso2.com,
> *
> *
> *Member; Apache Software Foundation; 
> **http://www.apache.org/*<http://www.apache.org/>
> *
> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
> *
> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
> *
> *
> *Lean . Enterprise . Middleware*
>
>


-- 
*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://www.linkedin.com/in/senakafernando

*Lean . Enterprise . Middleware
_______________________________________________
Carbon-dev mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to