Hi,

On Wed, Jul 4, 2012 at 6:35 PM, Afkham Azeez <az...@wso2.com> wrote:

> Tenant deletion is a very rare usecase. So, we need not complicate things
> at this moment. Please note that deleted tenant IDs should not be reused.
> So, my suggestion is, don't fix this.
>
>
+1.

thanks,
dimuthu


>
> On Wed, Jul 4, 2012 at 6:23 PM, Muhammed Shariq <sha...@wso2.com> wrote:
>
>> Hi folks,
>>
>> To provide some background, currently in JDBCTenantManager we have two
>> maps namely tenantIdDomainMap and tenantDomainIdMap to act as a cache when
>> fetching a tenant's id via domain name or vise-versa. Whenever we try to
>> obtain the id via domain for example, it first checks if that particular
>> domain is present in the tenantDomainIdMap, and if only if its not
>> available it checks the DB.
>>
>> We however never clear these tow maps, so if there is a domain-id mapping
>> it exist as long as the server is running. Note that we have these maps per
>> Stratos service, meaning AS, ESB, DSS etc maintains its own map
>> locally. Previously this was no issue since we didn't have the facility to
>> delete a tenant, but when trying to create the tenant deletion patch, I
>> came across some issues since we never clear this map.
>>
>> For example say we have a tenant foo.com with TID - 10. If this tenant
>> logs into AS, the locals maps will contain the mapping tenant foo.com<=> TID 
>> - 10. Next we delete the tenant from Manager and also the delete
>> the entry in the locals maps of Manager, but still we have no way of
>> clearing the domain <=> ID mapping in AS (or any other service). So if we
>> create another tenant foo.com with TID-12 AS will still have the old
>> domain-id mapping, which obviously causes issue.
>>
>> So I am looking for a way to clear these two maps. One suggestion was to
>> delete the domain-id mapping when unloading the tenant. For this we need to
>> add static getter methods for the two maps, not sure if that's a good idea,
>> or have a scheduled thread to cleanup the map periodically, or else have an
>> overloaded method, getTenantId(String tenantDomain, boolean readDB) ... ?!
>>
>> Please suggest what would be the best way to clean up the local domain-id
>> mapping ...
>>
>> --
>> Thanks,
>> Shariq.
>> Phone: +94 777 202 225
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>**
> email: **az...@wso2.com* <az...@wso2.com>* 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*
>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to