system.db.clearAllNamedQueryCaches
This function is used in Python Scripting.
Descriptionβ
This clears the caches of all Named Queries in a project. If called from the shared scope (i.e., Tag Event Scripts, Alarm Pipelines, etc.), then the name of the project must be passed as a parameter.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntax - Project Scopeβ
system.db.clearAllNamedQueryCaches()
Parametersβ
None
Returnsβ
No Return Value
Scopeβ
Vision Clients
Syntax - Shared Scopeβ
system.db.clearAllNamedQueryCaches()
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| String | project | The Project that contains the named query whose cache needs to be cleared. |
Returnsβ
No Return Value
Scopeβ
Gateway, Perspective Session
Code Examplesβ
Example - Clear All Named Query Cache for a Specific Project
# Calling this simply clears all Named Query caches.
# This is assumed to run in the Shared Scope, so the name of the project must be included.
system.db.clearAllNamedQueryCaches("myProjectName")
Example - Clear All Named Query Cache
# If multiple Named Queries with varying parameters are called in a single script, then clearAllNamedQueryCaches can be used to free up the memory used by all of the newly created caches.
# This example is assumed to run in the Project Scope, so the project parameter may be omitted.
# This creates one cache.
params = {"param1":"A"}
system.db.runNamedQuery("myUpdateQuery", params)
# This creates a separate cache.
params = {"param1":"B"}
system.db.runNamedQuery("anotherUpdateQuery", params)
# Clear all of the caches from the current project. Note that all caches are cleared, including those generated from elsewhere on the Gateway.
system.db.clearAllNamedQueryCaches()