Skip to main content
Skip table of contents

Clear Metadata Cache - Metadata Server

By default, Metadata Server caches a copy of the information it retrieves from the external metadata database, so that it does not have to keep querying the database. In addition, SuperWEB2 caches some of the information it receives from Metadata Server, so that it does not have to keep querying the database.

When you make changes to your metadata, you may need to clear one or both of these caches in order to see the changes in the SuperSTAR clients.

Clear the Metadata Server Cache

To clear the Metadata Server cache, you either need to restart the Metadata Server, or use the supplied cache flush tool (metadata_cacheflush.exe). This tool is located in the SuperSERVER program files directory (by default, C:\Program Files\STR\SuperSERVER SA).

If users are currently logged in to one of the SuperSTAR clients when you clear the cache, then they may not see the updates to the metadata immediately. This is because the clients also cache a local copy of the metadata.

For example, users who are logged in to SuperWEB2 may not see the updates until they change the dataset language or log out and log back in again. SuperCROSS users may not see the changes until they restart SuperCROSS.

Clear the Cache

To clear the cache, open a command prompt and change to the SuperSERVER program files directory, then run the tool using the following options:

CODE
metadata_cacheflush [ -s <server> ] [ -p <port> ] [ -d <dataset_id> ]

Where:

<server>
The name of the Metadata Server to connect to. If you do not specify a server, it will default to localhost.
<port>
The port the Metadata Server is listening on. If you do not specify the port, it will default to 8005.
<dataset_id>

The ID of the dataset to clear from the cache. If you do not specify a dataset ID then the cache will be cleared for all datasets.

You can specify multiple datasets if necessary; separate the IDs with either a comma (,) or semi colon (;).

For example, the following command clears the cache for the bank dataset, on the instance of Metadata server running on myserver:

CODE
metadata_cacheflush -s myserver -d bank

The following examples clear the cache for the bank and people datasets:

CODE
metadata_cacheflush -d bank;people

Clear the Entire Cache

To clear the entire Metadata Server cache for all datasets, simply run the cache flush tool without the -d option.

If your Metadata Server is running on localhost using the standard port number, then you can clear the entire cache by running the cache flush tool with no options at all.

Help using the Cache Flush Tool

The cache flush tool has a -h option that you can use if you need to check the valid arguments:

CODE
metadata_cacheflush.exe -h

Clear the SuperWEB2 Metadata Cache

In addition to the Metadata Server cache, SuperWEB2 also caches some of the information it receives from Metadata Server. You may also need to clear this cache to see any changes reflected in the SuperWEB2 client.

To flush the SuperWEB2 cache, use the following REST endpoint: /webapi/rest/metadata/flushCache

For example, if your SuperWEB2 is installed at http://myserver:8080/webapi/ then the full URL of the REST endpoint would be http://myserver:8080/webapi/rest/metadata/flushCache

Only administrator users (users who belong to the SuperADMIN group specified by the administratorGroup parameter in web.xml) can use this REST endpoint. There are a number of ways you can provide the appropriate authentication:

  • Log in to SuperWEB2 as an administrator user, then open the REST endpoint URL in the same browser. The endpoint will use your session cookie to validate your login. If you successfully call the endpoint you will see a blank page in your browser window.
  • Use a REST client, such as Postman to access the REST endpoint using HTTP Basic Authentication.

Regardless of whether you manually clear the cache, SuperWEB2 will periodically refresh its cache of information from the metadata database. You can control how frequently this happens by editing the metadata.cacheSpec setting in the configuration.properties file.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.