Clear Workspace Cache (Data Management Tools)
Summary
Clears information about a workspace that has been cached in memory.
Note:
Workspace caching is used by the geoprocessing framework to improve performance when running script tools or repeated processes. The workspace cache may hold a schema lock for a given workspace, and the cache can be cleared to allow other processes or functions to proceed.
Usage
The single input parameter is optional. If you run the tool without specifying a workspace, all contents in the workspace cache will be cleared. To remove cached information about a specific workspace, use that geodatabase, folder, or
.sdeconnection file as input.This tool can be used to help disconnect idle enterprise geodatabase connections in a long-running application.
To clear the workspace cache in a Python script, use this tool as the final call in the script. Use the Python
delstatement to delete all references to objects or variables that may be pointing to the workspace before calling this tool. If the script uses both ArcPy commands and other Python file and folder management commands, schema locks held by the workspace cache may prevent other Python commands from running successfully. Clearing the workspace cache enables these functions that delete or modify files or folders to succeed and not be blocked by schema locks.The first ten workspaces used in an ArcGIS Pro or a stand-alone Python process will be included in the workspace cache. Additional workspaces used in the same process will not be cached.
Note:
Clearing an enterprise geodatabase workspace from the workspace cache does not guarantee that the connection to the enterprise geodatabase server will be disconnected. It will only ensure that the ArcGIS system no longer has any hold on the enterprise geodatabase workspace that has been cleared. If any other process has references to this enterprise geodatabase workspace, the connection will be maintained.
Parameters
| Label | Explanation | Data type |
|---|---|---|
|
Input Workspace (Optional) |
The geodatabase, |
Data Element; Layer |
Derived output
| Label | Explanation | Data type |
|---|---|---|
|
Operation succeeded |
Whether the operation was successful. |
Boolean |
Environments
This tool does not use any geoprocessing environments.
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes