I have a script that needs to run a database compression in the middle so that I can run a SQL update statement. I allow new connections again after the compression, but the script fails because it can't see the database any longer. Is there any way to force the script to reconnect to the database after?
Here's a sample of the code. The first Exists shows the feature class is there, but the second one can't see it.
if arcpy.Exists(ACCOUNTS):
print "ACCOUNTS exists"
else: print "ACCOUNTS doesn't exist"arcpy.AcceptConnections(SDE_Connection, False)
arcpy.DisconnectUser(SDE_Connection, "ALL")
arcpy.Compress_management(SDE_Connection)
arcpy.AcceptConnections(SDE_Connection, True)if arcpy.Exists(ACCOUNTS):
print "ACCOUNTS exists"
else: print "ACCOUNTS doesn't exist"
GREAT question. I am having the exact same issue. Hoping ESRI can provide some insight.