Summary
Clears any enterprise geodatabase workspaces from the enterprise geodatabase workspace cache.
Usage
This tool only works with enterprise geodatabase workspaces.
This tool can be used to help disconnect idle enterprise geodatabase connections in a long-running application.
If you run the tool without specifying an Input data element, all enterprise geodatabase workspaces in the enterprise geodatabase workspace cache will be cleared. Specify the specific .sde file associated with the workspace you want to clear in order to clear a specific enterprise geodatabase workspace.
Syntax
arcpy.management.ClearWorkspaceCache({in_data})
Parameter | Explanation | Data Type |
in_data (Optional) | The enterprise geodatabase database connection file representing the enterprise geodatabase workspace to be removed from the cache. Specify the path to the enterprise geodatabase connection file that was used in running your geoprocessing tools in order to remove the specific enterprise geodatabase workspace from the cache. Passing no input parameter will clear all enterprise geodatabase workspaces from the cache. | Data Element; Layer |
Derived Output
Name | Explanation | Data Type |
out_results | Whether the operation was successful. | Boolean |
Code sample
ClearWorkspaceCache example (Python window)
The following Python window script demonstrates how to use the ClearWorkspaceCache function in immediate mode.
import arcpy
arcpy.env.workspace = "c:/connectionFiles/Connection to gpserver.sde"
arcpy.ClearWorkspaceCache_management()
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes