<?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 Bug in 'delete' part of applyEdits? in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/bug-in-delete-part-of-applyedits/m-p/1191517#M2588</link>
    <description>&lt;P&gt;If I try to delete features from either&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ServiceGeodatabase&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;ServiceFeatureTable&lt;/FONT&gt; I get an error like:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Object ID '885192' is not valid.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Adding and modifying features works. Also, if I go to hosted layer's REST web interface (at `&lt;A href="https://community.esri.com/" target="_blank"&gt;https://&amp;lt;domain&amp;gt;/server/rest/services/Hosted/&amp;lt;service&amp;gt;/FeatureServer/&amp;lt;table&amp;gt;/applyEdits`&lt;/A&gt;) I can delete features, so I assume delete operation is permitted.&lt;/P&gt;&lt;P&gt;What I did notice by stepping through the generated request in ArcGIS Runtime for Java is that it seems like &lt;FONT face="courier new,courier"&gt;objectid&lt;/FONT&gt;(s) are serialized as &lt;U&gt;string&lt;/U&gt;, not as &lt;U&gt;long&lt;/U&gt;. I looked at &lt;FONT face="courier new,courier"&gt;mParams&lt;/FONT&gt; in &lt;FONT face="courier new,courier"&gt;com.esri.arcgisruntime.internal.io.handler.request.HeadersAndBytesRequest&lt;/FONT&gt; constructor and I can see three parameters being used for applying single delete operation:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;deletes -&amp;gt; ["885192"]&lt;BR /&gt;rollbackOnFailure -&amp;gt; true&lt;BR /&gt;f -&amp;gt; json&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Assuming this is deserialized as JSON, it's clear that `deletes` holds an array of strings (instead longs).&lt;/P&gt;&lt;P&gt;Since HTTP request to API backend is built within native code and my ArcGIS installation is on HTTP&lt;STRONG&gt;S&lt;/STRONG&gt; (so no Wireshark either), I couldn't verify this, so I'm asking here.&lt;/P&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;P&gt;ArcGIS Runtime:&amp;nbsp;100.14.1&lt;/P&gt;&lt;P&gt;Java: OpenJDK 17&lt;/P&gt;&lt;P&gt;OS: Ubuntu 22.04 amd64&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jul 2022 13:01:39 GMT</pubDate>
    <dc:creator>gkresic</dc:creator>
    <dc:date>2022-07-12T13:01:39Z</dc:date>
    <item>
      <title>Bug in 'delete' part of applyEdits?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/bug-in-delete-part-of-applyedits/m-p/1191517#M2588</link>
      <description>&lt;P&gt;If I try to delete features from either&amp;nbsp;&lt;FONT face="courier new,courier"&gt;ServiceGeodatabase&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;ServiceFeatureTable&lt;/FONT&gt; I get an error like:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Object ID '885192' is not valid.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Adding and modifying features works. Also, if I go to hosted layer's REST web interface (at `&lt;A href="https://community.esri.com/" target="_blank"&gt;https://&amp;lt;domain&amp;gt;/server/rest/services/Hosted/&amp;lt;service&amp;gt;/FeatureServer/&amp;lt;table&amp;gt;/applyEdits`&lt;/A&gt;) I can delete features, so I assume delete operation is permitted.&lt;/P&gt;&lt;P&gt;What I did notice by stepping through the generated request in ArcGIS Runtime for Java is that it seems like &lt;FONT face="courier new,courier"&gt;objectid&lt;/FONT&gt;(s) are serialized as &lt;U&gt;string&lt;/U&gt;, not as &lt;U&gt;long&lt;/U&gt;. I looked at &lt;FONT face="courier new,courier"&gt;mParams&lt;/FONT&gt; in &lt;FONT face="courier new,courier"&gt;com.esri.arcgisruntime.internal.io.handler.request.HeadersAndBytesRequest&lt;/FONT&gt; constructor and I can see three parameters being used for applying single delete operation:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;deletes -&amp;gt; ["885192"]&lt;BR /&gt;rollbackOnFailure -&amp;gt; true&lt;BR /&gt;f -&amp;gt; json&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Assuming this is deserialized as JSON, it's clear that `deletes` holds an array of strings (instead longs).&lt;/P&gt;&lt;P&gt;Since HTTP request to API backend is built within native code and my ArcGIS installation is on HTTP&lt;STRONG&gt;S&lt;/STRONG&gt; (so no Wireshark either), I couldn't verify this, so I'm asking here.&lt;/P&gt;&lt;P&gt;Details:&lt;/P&gt;&lt;P&gt;ArcGIS Runtime:&amp;nbsp;100.14.1&lt;/P&gt;&lt;P&gt;Java: OpenJDK 17&lt;/P&gt;&lt;P&gt;OS: Ubuntu 22.04 amd64&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 13:01:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/bug-in-delete-part-of-applyedits/m-p/1191517#M2588</guid>
      <dc:creator>gkresic</dc:creator>
      <dc:date>2022-07-12T13:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in 'delete' part of applyEdits?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/bug-in-delete-part-of-applyedits/m-p/1194402#M2608</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I took a look through the code and the strings object IDs you see are further processed before being sent to the server. So, while there might be a problem I don't think it is related to processing the parameters.&lt;/P&gt;&lt;P&gt;I was wondering if you were trying to delete a feature newly created by apply edits and the object ID from the local feature object doesn't match the one in the table. You may need to call `Feature.refresh()` so that the OID of your local feature is updated to match that in the table. This isn't my area of expertise but I'm sure a colleague post with better information if this is wrong.&lt;/P&gt;&lt;P&gt;Colin&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 13:14:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/bug-in-delete-part-of-applyedits/m-p/1194402#M2608</guid>
      <dc:creator>ColinAnderson1</dc:creator>
      <dc:date>2022-07-21T13:14:39Z</dc:date>
    </item>
  </channel>
</rss>

