clearworkspacecache

RPLib – clearworkspacecache

RPLib.clearworkspacecache(Workspace=None)[source]

Clears any ArcSDE workspaces from the ArcSDE workspace cache.

Parameter Type Description Required
Workspace String Path to SDE connection file. Yes

Returns: Boolean

Usage

  • Only works with enterprise geodatabases.
  • Helps disconnect idle connections in long-running applications.
  • Should be run at the end of a script.

Example 1

Simple call with all parameters specified.

import RPLib

dataOwner = "C:/GIS/GISADMIN@GIS.sde"

RPLib.clearworkspacecache(dataOwner)

Example 2

If Else logic with all parameters specified.

import RPLib

dataOwner = "C:/GIS/GISADMIN@GIS.sde"

if RPLib.clearworkspacecache(dataOwner):
    print("successful, run another tool")
else:
    print("failed, run another tool")

Table Of Contents

Previous topic

Logging Variables

Next topic

pauseconnections

This Page