Select to view content in your preferred language

cannot get exclusive schema lock

3239
2
09-28-2010 10:49 AM
deleted-user-rQoEFM5qzbHE
Deactivated User
I have written a script where I set the value in a cell. Unfortunately, I am getting an error that says '
Cannot get exclusive schema lock. Either being edited or in use by another application.' However, all that is open is the ArcMap session that I am trying to run the tool from.
0 Kudos
2 Replies
ChrisSnyder
Honored Contributor
By "cell" do you mean a field value in a table or a raster pixel?

If it's the former, and you are using a cursor in your script, be sure to delete the reference to the cursor object. For example:

updateRows = gp.updatecursor(occBuffersUnionFC)
updateRow = updateRows.next()
while updateRow:
    if updateRow.FID_occ_buff_1320ft > -1:
        updateRow.OCCBUFF_TY = "Quarter Mile"
    if updateRow.FID_occ_buff_100m > -1:
        updateRow.OCCBUFF_TY = "100 Meter"
    if updateRow.FID_occ_buff_300ft > -1:
        updateRow.OCCBUFF_TY = "300 Feet"
    if updateRow.FID_occ_buff_165ft > -1:
        updateRow.OCCBUFF_TY = "165 Feet"  
    if updateRow.FID_mm_policy > -1:
        updateRow.OCCBUFF_TY = "Occupied Site"
    updateRows.updaterow(updateRow)
    updateRow = updateRows.next()
del updateRow
del updateRows
0 Kudos
deleted-user-rQoEFM5qzbHE
Deactivated User
It is a field value in a table. I wasn't even able to change the name of the folder, there must have been some sort of lock on it even after I closed all ArcMap instances. I had to reboot my computer and it has been working fine since. Thanks for the tip on the 'del' statements, they have been added to the code.
0 Kudos