I'm running the following tool in ArcGIS 10. I have an ArcPy Script like this:
import arcpy
from arcpy import env
env.workspace=r"C:/sde/lcimrl.sde"
fc="SDE.ATTACHMENTS\SDE.attachment_points"
fcRows = arcpy.SearchCursor(fc, "OBJECTID = 11365")
for row in fcRows:
print "I found one"
The feature with OBJECTID 11365 is just created.
It can find the feature if I run it as standalone script. But when I run it in the ArcMap's interactive python window or import it into a ArcTool toolbox and then run it, it cannot find the feature.
I have to force the refresh of the SDE connection in the ArcCatalog, and then I can get the point. Or I have to wait for a while, like several hours, then it can find the point.
I tried arcpy.ClearWorkspaceCache_management(
) and arcpy.refreshTOC()
. They do not help.
Any help is appreciated.