AnsweredAssumed Answered

how to disconnect user locks from file geodatabase

Question asked by bryanprice1 on Oct 5, 2016
Latest reply on Mar 29, 2019 by mkohlerpsl

the File Geodatabase is a ArcGIS term which uses a file folder structure to store geo enabled data. For one of my data maintenance nightly process i use python scripting to stop & block connections to my enterprise SQL database by using the commands...


# Set the necessary product code
import arcinfo


# Import arcpy module
import arcpy


# Local variables:
OwnerCurrentYr_sde = "Database Connections\\OwnerCurrentYr.sde"
OwnerCurrentYr_sde__2_ = OwnerCurrentYr_sde
OwnerCurrentYr_sde__3_ = "Database Connections\\OwnerCurrentYr.sde"
OwnerCurrentYr_sde__7_ = OwnerCurrentYr_sde__3_
OwnerCurrentYr_sde__5_ = "Database Connections\\OwnerCurrentYr.sde"
OwnerCurrentYr_sde__6_ = OwnerCurrentYr_sde__5_


# Stop new connections
arcpy.AcceptConnections("Database Connections\\OwnerCurrentYr.sde", False)


# Process: Disconnect all users
arcpy.DisconnectUser("Database Connections\\OwnerCurrentYr.sde", "ALL")


...... i then do other tasks to compress database, rebuild indexes, Analyze datasets and then i allow connections to begin connecting to the SQL database.
# Enable users to begin connections
arcpy.AcceptConnections("Database Connections\\OwnerCurrentYr.sde", True)


The above workflow works great for the SQL connections , but how do i do this for a file geodatabase?