Clearing tag history cache

Hello folks,

The doc page for storeTagHistory says:

Note that the Tag History system does cache tag data. Thus, if this function is called, the tag path and tag id are cached until the history provider or gateway are restarted. This means manually removing the tag from the sqlth_te table, and then calling this function again with the same path will not re-populate the tag execution table (especially so when working purely with virtual tag paths). Instead, the cache must first be cleared, and then a new entry will be added the next time this function is called.

Note the bold part. Alright, but how do I do this ?
I'm running tests for something I'm developing and I need to clear the tables to rerun them, but I can't figure out how to clear the cache.

I believe, the first part tells you.

Thus, if this function is called, the tag path and tag id are cached until the history provider or gateway are restarted.

1 Like

I don't want to have to restart the gateway every time.

Is there a better way than disabling then re-enabling the history provider ?
Ideally I'd like to do this with a function call.

You can get a reference to the provider through a GatewayContext.getTagHistoryManager().getTagHistoryProvider("ProviderName"), and call the startup() and shutdown() methods on it.

I don't know of any public facing method for clearing the cache manually.

1 Like

I can work with that. Thanks !