Hi All,

I need to update site property for multiple environments in a single go.

I can connect to all environments DB directly through a mechanism.

So I need to update the tables of the site property so that it reflects in all or any API for it.


Can anyone help me letting me know the tables in which the updates has to be made.


Thanks in advance...

Ajithkumar,

I'm not sure what your goal is....
You can just change the site property for each environment accordingly at yourhost.com/ServiceCenter.
Just go to the espace where the site property is placed and you can change it there in the site property tab.

If you really need to change the value of a site property in several environments at the same time, I suggest you create a web service to do it, instead of updating the database value directly. Updating the value in the database won't make applications use the site property's new value, because the old value will remain cached. You'll need to invalidate the tenant's cache in order for the values to become effective.


That being said, for future reference, the query to read a site property value is:

SELECT TOP 1 
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_SHARED].[PROPERTY_VALUE] 
FROM     
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_SHARED] 
    INNER JOIN  [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION] ON  [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[ID] =  [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_SHARED].[SITE_PROPERTY_DEFINITION_ID] 
WHERE 
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[IS_ACTIVE] = 1 AND 
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[ESPACE_ID] = @EspaceId AND 
    LOWER( [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[NAME]) = @SitePropertyName


Hi,

You are looking for the Site_Property_Definition and Site_Property_Shared entities, probably.
But if you change the value directly in database, you will need to find a way to invalidate the applications on every environment, as only then the new value will be fetched, and that may be more tricky than changing the value in the first place...

But I don't know how to invalidate the application cache in all the environments at once. 

Cheers.

Joey Moree wrote:

Ajithkumar,

I'm not sure what your goal is....
You can just change the site property for each environment accordingly at yourhost.com/ServiceCenter.
Just go to the espace where the site property is placed and you can change it there in the site property tab.

Thank you. Im aware of the way in which it has to be updated through service center. But I cant do it by logging in into my 100+ environments. To avoid manual effort Im looking to update the same directly in db. Is there a way for it.

P.S. João gave a very good answer, as through a web service you can change the value of the Site Property through logic and this will invalidate the cache. You just need this WB in every environment and call it for every environment.

João Pedro Abreu wrote:

If you really need to change the value of a site property in several environments at the same time, I suggest you create a web service to do it, instead of updating the database value directly. Updating the value in the database won't make applications use the site property's new value, because the old value will remain cached. You'll need to invalidate the tenant's cache in order for the values to become effective.


That being said, for future reference, the query to read a site property value is:

SELECT TOP 1 
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_SHARED].[PROPERTY_VALUE] 
FROM     
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_SHARED] 
    INNER JOIN  [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION] ON  [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[ID] =  [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_SHARED].[SITE_PROPERTY_DEFINITION_ID] 
WHERE 
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[IS_ACTIVE] = 1 AND 
     [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[ESPACE_ID] = @EspaceId AND 
    LOWER( [OUTSYSTEMS].DBO.[OSSYS_SITE_PROPERTY_DEFINITION].[NAME]) = @SitePropertyName


Thank you Joao. Is there an API for performing this operation. I think apart from updating it in the database the same needs to be updated in the server since site properties are cached.


Eduardo Jauch wrote:

P.S. João gave a very good answer, as through a web service you can change the value of the Site Property through logic and this will invalidate the cache. You just need this WB in every environment and call it for every environment.


Is there a WS or an API for it. So that I can implement that.

Eduardo Jauch wrote:

P.S. João gave a very good answer, as through a web service you can change the value of the Site Property through logic and this will invalidate the cache. You just need this WB in every environment and call it for every environment.

If there is an API. Can you please share me the link. Thanks in advance Eduardo and Joao


There isn't an API to update the value of any site property. You can implement a web service that changes the value of the specific site property you want and invalidates the cache.

Then you'll have to create an application that has a list of all your environments and calls that web service for each of them.

João Pedro Abreu wrote:

There isn't an API to update the value of any site property. You can implement a web service that changes the value of the specific site property you want and invalidates the cache.

Then you'll have to create an application that has a list of all your environments and calls that web service for each of them.


Thank you Joao. I got ur point. How can I invalidte the cache through an application.

Solution

There are two system actions that allow you to invalidate the cache:

 

For your scenario, you probably want to use EspaceInvalidateCache.

Solution

Thank you Joao for ur help.