Changing Site Properties

Changing Site Properties

Is it possible to change a site property from a different espace without calling a action to do so?
Filipe -

Not directly, you will need to write a Public Action to make the change.

You can change the site-property directly by using the System entities.

Site_Property_Definition => definition of the Site_property (name / espace_id / IsShared)
Site_Property_Shared => the value of the Site_property (IsShared => not multi-tenent)
Site_Property => the value per tenent (Not IsShared)

After updating a PROPERTY_VALUE, you must execute the system action EspaceInvalidateCache, this invalidates the cache for a specific eSpace / tenent. 

Matthias -

Yes, but what about any other eSpaces that may be using it? You don't know which eSpaces directly or indirectly depend on that value, which means you don't know which eSpaces need to have their caches invalidated... and running that for ALL eSpaces, unless this is a really rare thing, it pretty bad for performance.

Is it really so that you have to also invalidate the consuming eSpaces? Is this also done when you change a site-property from ServiceCenter?
Well, to be honest. if you need to change site-properties via either an action and/or database, the question rises why it's a site-property in the first place...

Good question, you could of course use a Public entity where the settings are stored for your application; then there are no problem with cached values.

Adam -

Oh, of course, you don't need to invalidate the consumers, my mistake.

All the same, if you need access that direct, a Site Property strikes me as the wrong way to do things.

S&W -

The way caching is automatically done/invalidated with Site Properties are the best reason to use them in my opinion. We do not use very many site properties, but when we do, it is for a small value that is accessed very often and rarely changed. We reduced the number of queries to our DB by something like 10% just by copying the country ID of our tenants' addresses in a Site Property, for example. Not a bad performance improvement in exchange for maybe 200 bytes of memory per tenant. :D


I the correct ways to change the Site Properties is to have the public action or in Service Center.
Those already take care of the cache invalidations to invalidate only the minimum necessary, depending only on the owner espace of the site property and the tenant (this is valid for 7.0+).

I think the main question here is why is "without calling a action" a requirement.

João Rosado