Opened 11 years ago

Closed 11 years ago

#5216 closed defect (invalid)

Updating feature fails with FileGDB driver

Reported by: jpalmer Owned by: Even Rouault
Priority: normal Milestone: 1.10.1
Component: default Version: unspecified
Severity: normal Keywords: FileGDB
Cc:

Description (last modified by jpalmer)

I'm testing GDAL/OGR 1.10.1 RC1 and it seems FileGDB feature updating is broken after r26310.

e.g

filegdb_ds = ogr.Open('test.gdb', True)
layer = filegdb_ds.GetLayerByName('test')

f = layer.GetNextFeature()
layer.ResetReading()
layer.SetFeature(f)

Returns "Failed updating row (Cannot acquire a lock.)"

I also tested using SetAttributeFilter() then SetFeature() and I got the same result.

Attachments (1)

test.py (385 bytes ) - added by jpalmer 11 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by jpalmer, 11 years ago

Description: modified (diff)

comment:2 by Even Rouault, 11 years ago

Jeremy,

I've tried to reproduce your issue, and I don't get any error. I also changed the value of a field before calling SetFeature() and the update was well taken into account.

What is your OS (Linux/Windows, 32/64 bit) ? Perhaps you could also attach the database ?

Are you also sure that r26310 is the commit that causes your issue ? Reviewing it, I'm quite confident that it should have no impact on the scenario you've tested.

comment:3 by jpalmer, 11 years ago

Thanks. I'll get a test case together. I'm running Ubuntu 12.04 64bit fully patched and FileSDK 1.3.

I haven't tested the script before r26310.

by jpalmer, 11 years ago

Attachment: test.py added

comment:4 by jpalmer, 11 years ago

Test script attached. gdb can be downloaded here https://dl.dropboxusercontent.com/u/30623980/geodetic_marks.gdb.tar.bz2

Traceback was:

Traceback (most recent call last):

File "/home/jpalmer/tmp/filegdb_test/test.py", line 15, in <module>

geodetic_marks.SetFeature(f)

File "/usr/local/lib/python2.7/dist-packages/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/ogr.py", line 1216, in SetFeature

return _ogr.Layer_SetFeature(self, *args)

RuntimeError: Error: Failed updating row (Cannot acquire a lock.)

comment:5 by Even Rouault, 11 years ago

Hum, I still don't reproduce with your script and data. The apparent difference is that I still use the old Ubuntu 10.04. I'll try to reproduce in a 12.04 VM. Perhaps could you test commenting gdal.SetConfigOption('FGDB_BULK_LOAD', 'YES') to see if it makes a difference ? Another idea to test is to remove all the *.lock files in the geodetic_marks.gdb directory, in case of a dangling one causing issue.

comment:6 by Even Rouault, 11 years ago

I've just tried in a Ubuntu 12.04 64 bit VM up-to-date, with FileGDB API 1.3, and still no issue.

comment:7 by jpalmer, 11 years ago

Resolution: invalid
Status: newclosed

Hi Even,

Really sorry about this but you are right. I've finally tracked the problem down. I needed to reboot the server. Not sure why this helped, but I guess some other file handle was still open to the database.

Warm regards Jeremy

Note: See TracTickets for help on using tickets.