...
Despite the improved performance, repository caching is disabled, by default, as it can interfere with the development process.
As implied, once a screen definition has been cached, it won't take into account any additional changes done to the screen itself until the cached version is removed.
To activate it, one simply needs to add the caching service to the application's services XML file:
Info |
---|
|
<ttServiceLoaderRow> <Order>10</Order> <ServiceTypeName>Akioma.Swat.Repository.Cache.IRepositoryCacheService</ServiceTypeName> <ServiceClassName>Akioma.Swat.Repository.Cache.DatabaseRepositoryCacheService</ServiceClassName> </ttServiceLoaderRow> |
...
As of SWAT Release 19.11.0, the repository cache service itself provides a clear cache method to clear all the screens matching the specified MATCHES pattern.
Info |
---|
title | Clearing the whole cache through the service |
---|
|
DEFINE VARIABLE oCacheService AS Akioma.Swat.Repository.Cache.IRepositoryCacheService NO-UNDO. oCacheService = {Consultingwerk/get-service.i Akioma.Swat.Repository.Cache.IRepositoryCacheService}. IF VALID-OBJECT(oCacheService) THEN oCacheService:ClearCache("*"). |
...
Info |
---|
|
DEFINE VARIABLE hDataset AS HANDLE NO-UNDO. Consultingwerk.OERA.ServiceInterface:FetchDataset(Akioma.Swat.Repository.Cache.DatabaseRepositoryCacheService:CacheBusinessEntity, DATASET-HANDLE hDataset). Consultingwerk.OERA.ServiceInterface:InvokeMethod(Akioma.Swat.Repository.Cache.DatabaseRepositoryCacheService:CacheBusinessEntity, "ClearCache", DATASET-HANDLE hDataset, NEW Consultingwerk.CharacterHolder("*")). |
...