Invalidate cache on SQL doesn't work.

In my sample module "CE_Sample" I have entity "Results".

In server action "Results_GetForDisplaying" I call an SQL query and set a "Cache in minutes" of 15 minutes.

The data only changes when calling the Result_CreateUpdate and Result_Delete functions.
Therefore I put in those actions after the create/update or delete an EspaceInvalidateCache action.

That action requires two inputs (optional).
   * EspaceId
   * TenantId

In the EspaceId I used the following values:
   * GetOwnerEspaceIdentifier()
   * GetEntryEspaceId()
   * Blank (no value) - this will result in espaceId of the caller eSpace.

None of them are doing the trick.

I think i have to put in the current espace id but I can't find a function to pass it along.

Does someone have a good idea? I can't seem find to get better documentation about Cache and Invalidating it.

Thanks,

Peter

Hello Peter,

If the server action which is caching the data and the server action which is invalidating the cache is in the same module, it is straight forward. You can use GetOwnerEspaceIdentifier() which will return the identifier of the module that owns the element that is being processed to invalidate the espace cache. 

If the server actions are in different modules, expose a public server action with EspaceinvalidateCache using GetOwnerEspaceIdentifier to invalidate the cache of the espace and consume this server action from other module.  


let me know if you need further information.


Babu Basha wrote:

Hello Peter,

If the server action which is caching the data and the server action which is invalidating the cache is in the same module, it is straight forward. You can use GetOwnerEspaceIdentifier() which will return the identifier of the module that owns the element that is being processed to invalidate the espace cache. 

If the server actions are in different modules, expose a public server action with EspaceinvalidateCache using GetOwnerEspaceIdentifier to invalidate the cache of the espace and consume this server action from other module.  


let me know if you need further information.


Hi Babu,


Thanks for your fast reply!

It doesn't work for me :(.

The scenario is that our App is calling the CE_Sample "Results_GetForDisplaying" action. But even if we are invalidating the data inside the CE_Sample application (The app is unaware of changes in the data) it still retrieves the old data.


Hello Peter, 


Is it possible to post sample oml file of your changes, I have invalidated cache in my app this way and it usually works fine. 


May be you can try to cache the method instead of SQL to see if it works. 


Thanks,

Babu