Official Content

The timeout of the GeneXus Access Manager (GAM) cache, which stores information of the Repository, Applications, Permissions and Events subscription data, is configured in the application server to improve performance. In this way, there's no need to query the database every time the information is needed. While the Cache does not expire, the information is managed in the server memory.

The information stored in cache is as follows:

  • Repository data, for example, UserIdentification (name, email, or both).
  • Repository Authentication Types data.
  • The connection.gam file information.
  • Applications data (the general information, Client Application Data, Remote Authentication and Environment Settings)
  • Permissions of the applications in the repository.
  • Role Permissions of each application in the repository.
  • User Permissions of each application in the repository.
  • EventSubscriptions data.

The purpose of this property is to avoid querying the database every time the repository information is needed.

The cache information is reset every time the data is updated. For example, if a permission is associated with a role, this cache information is automatically updated. So, the information retrieved is always updated.

Syntax

&GAMRepository.CacheTimeout   = &RepositoryCacheTimeout (minutes)

Default Value

0: The GAM cache never expires.

In load balancing architectures, you should set the Cache Provider property to use a distributed caching.

Note: Previous to GeneXus 17 upgrade 2, it's necessary to adjust the Cache Timeout property so that all the nodes have coherence in the information used for the repository because distributed caching is not supported in GAM. If you need to change any repository settings in a clustered environment, you may need to clean the cache for the changes to take effect in all nodes.

When the following lines of code are executed, the Repository cache is forced to clear:

&Repository.Load(&Id) //&Repository is GAMRepository data type. Load the current Repository.
&Repository.Save()
if &Repository.Success()
  Commit
endif

When the Repository settings are changed, using GAM API or just using the GAM - Examples of GAM Backoffice, the Repository cache of the web server is cleared. Consider that you need to update the repository settings in all the nodes of the cluster.

Use the ClearCache method of GAMRepository object to force the cache clear in every web app where you run the code.

Since GeneXus 15 upgrade 7, this method clears all the cache (not only the repository cache).

GAMRepository.GetId(&Id)
&Repository.load(&Id)
&Repository.ClearCache()

See Also

User Session Cache Timeout (seconds)
GAM Repository features and properties

   

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant