arcpy DisableEditorTracking_management

505
1
Jump to solution
01-19-2022 04:39 PM
JeffHouser
Occasional Contributor

ArcGIS Desktop 10.6.1.  Creating command line arcpy script

Script:

Get a list of databases within the gdb, and a list of associated feature classes for each database.  Then sequentially, update a field called "Admin_Date" w/ today's date for each feature class, within each database.

This works perfectly.  However, I'm trying to disable tracking, so the tracking fields are not updated when "Admin_Date" is populated.  Below is the code:

import arcpy
#Set Overwrite Option
arcpy.env.overwriteOutput = True
# set the workspace to be able to use the ListDatasets and ListFeatureClasses
arcpy.env.workspace = r"C:\Users\Forestry_GIS\Forestry_GIS.gdb"
fds = arcpy.ListDatasets(feature_type='Feature')
for fd in fds:
fcs = arcpy.ListFeatureClasses(feature_dataset=fd)
for fc in fcs:
print ('Database: ' + fd + ' Feature Class: ' + fc)
arcpy.ClearWorkspaceCache_management()
arcpy.DisableEditorTracking_management(fc)
print("Finshed Disable Editor Tracking")
I get the following error when I run the above code:
Database: Forestry Feature Class: Usal_Ownership
Traceback (most recent call last):
File "UpDateAdminDate_Finalet.py", line 20, in <module> "DISABLE_LAST_EDIT_DATE")
File "C:\Program Files (x86)\ArcGIS\Desktop10.6\ArcPy\arcpy\management.py", line 3884, in DisableEditorTracking
raise arcgisscripting.ExecuteError: ERROR 000464: Cannot get exclusive schema lock. Either being edited or in use by another application.
Failed to execute (DisableEditorTracking).

Any suggestions to allow DisableEditorTracking_Management to work.
Thank You,
Jeff

 

0 Kudos
1 Solution

Accepted Solutions
JeffHouser
Occasional Contributor

For solution to my original posting, I tested the followling posting & replies on the Esri Community site:
https://community.esri.com/t5/logistics-questions/editor-tracking/td-p/414772.  This solution prevents the "DisableEditorTracking_Management" error 000464.

View solution in original post

0 Kudos
1 Reply
JeffHouser
Occasional Contributor

For solution to my original posting, I tested the followling posting & replies on the Esri Community site:
https://community.esri.com/t5/logistics-questions/editor-tracking/td-p/414772.  This solution prevents the "DisableEditorTracking_Management" error 000464.

0 Kudos