<?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 Re: Save edits Error (Violation of PRIMARY KEY) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/save-edits-error-violation-of-primary-key/m-p/640884#M59817</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;P&gt;Can't figure out what the issue is.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Apr 2019 15:27:12 GMT</pubDate>
    <dc:creator>MatthieuThery1</dc:creator>
    <dc:date>2019-04-30T15:27:12Z</dc:date>
    <item>
      <title>Save edits Error (Violation of PRIMARY KEY)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/save-edits-error-violation-of-primary-key/m-p/640883#M59816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a simple Feature Class stored in a SDE. It is registered as versionned with option to move edits to base.&lt;/P&gt;&lt;P&gt;I am using the arcGIS API to add new features to it via a FeatureLayer service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue I have is "sometimes" the edits are not saved, and it's coming with an error. When I go into the logs in the Server's manager, I can see the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;EM&gt;Error: Underlying DBMS error [[Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of PRIMARY KEY constraint 'R7_pk'. Cannot insert duplicate key in object 'dbo.MyLayer'. The duplicate key value is (...).].&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I let the database generate the primary keys, so the objectids definitely don't exist prior to me trying to add a new feature. When it happens, I sometimes have to restart the service to make it work (or this is maybe a coincidence/psychological).&lt;/P&gt;&lt;P&gt;As I say it is not systematic, and I can't find a pattern as to when/why it happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2019 15:23:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/save-edits-error-violation-of-primary-key/m-p/640883#M59816</guid>
      <dc:creator>MatthieuThery1</dc:creator>
      <dc:date>2019-04-12T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Save edits Error (Violation of PRIMARY KEY)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/save-edits-error-violation-of-primary-key/m-p/640884#M59817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;P&gt;Can't figure out what the issue is.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Apr 2019 15:27:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/save-edits-error-violation-of-primary-key/m-p/640884#M59817</guid>
      <dc:creator>MatthieuThery1</dc:creator>
      <dc:date>2019-04-30T15:27:12Z</dc:date>
    </item>
  </channel>
</rss>

