<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic UpdateCursor locking file geodatabase in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127297#M3341</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, as a matter of fact, if I use .getfeature, I can reset the value.&amp;nbsp; Thanks for that tip!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, using the cursor still doesn't work.&amp;nbsp; For what it's worth, a file gets created in my file GDB at this line: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim updatecursor As IFeatureCursor = pfc.Update(queryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The file is named "myfc.wr.lock" where 'myfc' is the name of the featureclass in the GDB.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim updatecursor As IFeatureCursor = pfc.Update(queryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat = updatecursor.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat.Value(9) = 121.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updatecursor.UpdateFeature(pfeat)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Apr 2010 11:44:02 GMT</pubDate>
    <dc:creator>MikeTischler</dc:creator>
    <dc:date>2010-04-05T11:44:02Z</dc:date>
    <item>
      <title>UpdateCursor locking file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127295#M3339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm attempting to perform a query on a featureclass in a file geodatabase and update attribute values for the&amp;nbsp; features returned from the query on the featureclass.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm able to query the FC through Iqueryfilter and get an update cursor.&amp;nbsp; However, whenever I perform this operation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Dim updatecursor As IFeatureCursor = pfeatureclass.Update(queryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it appears to lock the featureclass in the file geodatabase, so that I can't set the attribute values later, as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pfeat as Ifeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat = updatecursor.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat.Value(9) = 121.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updatecursor.UpdateFeature(pfeat)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The specific error I'm receiving is on the pfeat.value(9) = 121.1 and is unfortunately not very descriptive:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"Error HRESULT E_FAIL has been returned from a call to a COM component."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&amp;nbsp; I've tried the few developers examples I've seen, but they aren't much help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Apr 2010 18:56:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127295#M3339</guid>
      <dc:creator>MikeTischler</dc:creator>
      <dc:date>2010-04-02T18:56:45Z</dc:date>
    </item>
    <item>
      <title>UpdateCursor locking file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127296#M3340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Michael,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a pretty strange error, but I'm a bit skeptical that it's caused by the update cursor. If you retrieve a feature with a known ObjectID (using IFeatureClass.GetFeature) and then try to apply a value using Value(9), does that work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, are you using an edit session and edit operation? These may or may not be necessary depending on the type of data you're working with; for example, editing is required if your feature class participates in a topology. (Granted, this is not the exact behavior I would expect to see in that case either.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Apr 2010 19:28:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127296#M3340</guid>
      <dc:creator>JamesMacKay</dc:creator>
      <dc:date>2010-04-02T19:28:58Z</dc:date>
    </item>
    <item>
      <title>UpdateCursor locking file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127297#M3341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, as a matter of fact, if I use .getfeature, I can reset the value.&amp;nbsp; Thanks for that tip!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, using the cursor still doesn't work.&amp;nbsp; For what it's worth, a file gets created in my file GDB at this line: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim updatecursor As IFeatureCursor = pfc.Update(queryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The file is named "myfc.wr.lock" where 'myfc' is the name of the featureclass in the GDB.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim updatecursor As IFeatureCursor = pfc.Update(queryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat = updatecursor.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat.Value(9) = 121.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updatecursor.UpdateFeature(pfeat)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 11:44:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127297#M3341</guid>
      <dc:creator>MikeTischler</dc:creator>
      <dc:date>2010-04-05T11:44:02Z</dc:date>
    </item>
    <item>
      <title>UpdateCursor locking file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127298#M3342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, as a matter of fact, if I use .getfeature, I can reset the value.&amp;nbsp; Thanks for that tip!&amp;nbsp; That method works even after I create and set the featurecursor, too.&amp;nbsp; So, I guess that means the gdb isn't locked?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, using the cursor to set the features still doesn't work.&amp;nbsp; Near as I can figure, the cursor is returning a valid feature.&amp;nbsp; I can display pfeat.oid after the first .nextfeature call, and I get the correct value for the OID. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Oh, I'm not using and edit session and edit operation.&amp;nbsp; I don't believe the FC participates in any topology...it's just a bunch of simple point features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For what it's worth, a file gets created in my file GDB at this line: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim updatecursor As IFeatureCursor = pfc.Update(queryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The file is named "myfc.wr.lock" where 'myfc' is the name of the featureclass in the GDB.&amp;nbsp;&amp;nbsp; That's what was making me think the GDB was being locked.&amp;nbsp; The code block is below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pfeat as IFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim updatecursor As IFeatureCursor = pfc.Update(queryFilter, False)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat = updatecursor.NextFeature&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeat.Value(9) = 121.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updatecursor.UpdateFeature(pfeat)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 11:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127298#M3342</guid>
      <dc:creator>MikeTischler</dc:creator>
      <dc:date>2010-04-05T11:55:06Z</dc:date>
    </item>
    <item>
      <title>UpdateCursor locking file geodatabase</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127299#M3343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;James,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I've identified the problem.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was setting the queryfilter to only return a few subfields.&amp;nbsp; The field which I was updating was NOT one of the ones included in the subfieds property. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Only myself to blame for this one...thanks for the help, though!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 15:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/updatecursor-locking-file-geodatabase/m-p/127299#M3343</guid>
      <dc:creator>MikeTischler</dc:creator>
      <dc:date>2010-04-05T15:52:28Z</dc:date>
    </item>
  </channel>
</rss>

