cancel
Showing results for 
Search instead for 
Did you mean: 

Repository.getRootHome() and multitenancy

valery_antonov
Champ in-the-making
Champ in-the-making
there is repositoryHelper bean, with org.alfresco.repo.model.Repository class, used in several places, including patches. Repository .getRootHome() is used as a starting point for the search, for example ActivitiesTemplatesUpdatePatch.getBaseTemplate()

Problem is, that getRootHome() is not tenancy-safe, it lazily stores rootRef. BTW, getCompanyHome() just nearby doesnt use getRootHome(), so it is tenancy safe.

I dont understand, how it is supposed to work - was multitenancy ever tested in 4.0.d?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

I'd assume any version of Alfresco Enterprise 4 is tested with multi-tenancy - I mean, the Alfresco Cloud is running on a variant of Alfresco 4. The question is: Has anybody tested the patches on a multi-tenant environment? Or do the patches that rely on the getRootHome() actually have to be tenancy safe - i.e. what if they are just one-off patches for newly installed repostories that can't yet have tenants?

IF you have found a case where these patches do not work, feel free to open a JIRA ticket in the Alfresco system.
I can see that the current implementation of getRootHome() is problematic for any one that expects it to be tenancy safe - I would rather remove this method (since it is just a trivial piece) than see it fixed.

Regards
Axel

valery_antonov
Champ in-the-making
Champ in-the-making
Yes, getRootHome() is already known bug, it also affects web scripts. And yes, alfresco 4.0.d couldnt apply patches to multitenant repo.

When we decided to support multitenancy, we reviewed our code, catching all stored node refs. After that we got several more bugs, and yes, now it is ok Smiley Happy Guess Alfresco team also need to do multitenancy reviews…