Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ArcGIS file geodatabase
#1
Is there a Python command to remove locks from a ArcGIS file geodatabase?  similar to the ...
  • arcpy.DisconnectUser
  • arcpy.AcceptConnections
  • arcpy.AcceptConnections
... would be used on a sde connection (sql database user connection) 

When a user of ArcGIS Desktop (or runtime application) makes a connection to a file geodatabase, it creates a ***ComputerName_blabla.lock file. i have  a process that runs nightly that deletes and replaces some tables, but inevitably i have 5-7 users that leave their application open thus preventing the process to run because there is a schema lock.

Hope this is enough info
Reply
#2
I don't think we have any regulars here who use ArcGIS. What is the context in which you're asking? Are you asking about how to do something in Python in addition to other Python stuff you're doing with it? Are you using a module? Or do you want to start using Python? What are you doing now instead? (Unless you want to limit answerers to ArcGIS users, explaining how we can reproduce the problem will go a long way.)
Reply
#3
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?
Reply
#4
You might find a more satisfactory answer in an ArcGIS forum.
Reply
#5
ok thx
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python bug in ArcGIS - Urban Network analysis tool stanimirasn 0 2,212 Jul-29-2018, 06:08 PM
Last Post: stanimirasn

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020