<?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: Branch versioning - Deleting a version cause the published service to be corrupted in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/branch-versioning-deleting-a-version-cause-the/m-p/1596199#M13392</link>
    <description>&lt;P&gt;Hi Pierre,&lt;/P&gt;&lt;P&gt;I have not seen sluggish query when zooming in/out but I've seen the expected lock errors when editing the same version simultaneously from different apps.&lt;/P&gt;&lt;P&gt;How are you creating the ServiceGeodatabase? If you're opening from a web map, there is a load setting that you can set to persistent if you wish to lock the version for editing. It is transient by default. If you've created from URL, be sure all layers and tables of the map come from the same service geodatabase. Use the service geodatabase to apply the edits (instead of table apply edits). More information about session management &lt;A title="FeatureServiceSessionType" href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.ArcGISServices.FeatureServiceSessionType.html" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;When starting from web map&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var map = new Map(new Uri(WebmapItemUrl));
map.LoadSettings = new LoadSettings() { FeatureServiceSessionType = FeatureServiceSessionType.Persistent };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When starting from feature service URL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var sgdb = await ServiceGeodatabase.CreateAsync(featureServiceUrl, FeatureServiceSessionType.Persistent); // specify session mode&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be sure to call close at the end when done with working on the branch version to release the read/write locks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var parameters = new ServiceVersionParameters()
{
Name = $"VALID_VERSION_{digits}",
Description = versionDescription,
Access = VersionAccess.Private
};
var serviceVersionInfo = await sgdb.CreateVersionAsync(parameters); // create version

await sgdb.SwitchVersionAsync(serviceVersionInfo.Name); // switch

var layer = sgdb.GetTable(serviceLayerId); // all layers/tables

await sgdb.CloseAsync(); // when done&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Opening the same version in ArcGIS Pro or Map Viewer will attempt to acquire read and write locks as well. On the server, there's &lt;A title="Purge Lock" href="https://developers.arcgis.com/rest/services-reference/enterprise/purge-lock/" target="_self"&gt;purge lock&lt;/A&gt; and &lt;A title="Delete " href="https://developers.arcgis.com/rest/services-reference/enterprise/delete/" target="_self"&gt;delete&lt;/A&gt; version that will allow you to cleanup versions that should be released and deleted.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Mar 2025 16:58:15 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2025-03-17T16:58:15Z</dc:date>
    <item>
      <title>Branch versioning - Deleting a version cause the published service to be corrupted</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/branch-versioning-deleting-a-version-cause-the/m-p/1595550#M13386</link>
      <description>&lt;P&gt;We've developped a Windows app that uses ArcGIS Maps SDK .Net. That app displays and edits data from a published service on our portal that is in branch versioning.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When connecting to the service, the app creates a new version and uses it.&lt;/P&gt;&lt;P&gt;Then I do a few edits and apply them. I go back in ArcGIS Pro and I delete the version I just created so I can redo my tests in our app (meening a new version with the same name is recreated). But then the service acts really strange, some graphics are not showing when I zoom in and zoom out, some simple calls like GetRecordCount fails with bad json but when I retry them it passes and when I try to redo my edits and apply them it says that it cannot open an edit session or something like that.&lt;/P&gt;&lt;P&gt;The only way I found to not have this problem is when I delete the version, I republish my map overriting the existing service. Then it's all good. But I think I should'nt have to do that?&lt;/P&gt;&lt;P&gt;Can you help me understanding what's hapening please?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 12:33:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/branch-versioning-deleting-a-version-cause-the/m-p/1595550#M13386</guid>
      <dc:creator>PierreMasson</dc:creator>
      <dc:date>2025-03-14T12:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Branch versioning - Deleting a version cause the published service to be corrupted</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/branch-versioning-deleting-a-version-cause-the/m-p/1596199#M13392</link>
      <description>&lt;P&gt;Hi Pierre,&lt;/P&gt;&lt;P&gt;I have not seen sluggish query when zooming in/out but I've seen the expected lock errors when editing the same version simultaneously from different apps.&lt;/P&gt;&lt;P&gt;How are you creating the ServiceGeodatabase? If you're opening from a web map, there is a load setting that you can set to persistent if you wish to lock the version for editing. It is transient by default. If you've created from URL, be sure all layers and tables of the map come from the same service geodatabase. Use the service geodatabase to apply the edits (instead of table apply edits). More information about session management &lt;A title="FeatureServiceSessionType" href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.ArcGISServices.FeatureServiceSessionType.html" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;When starting from web map&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var map = new Map(new Uri(WebmapItemUrl));
map.LoadSettings = new LoadSettings() { FeatureServiceSessionType = FeatureServiceSessionType.Persistent };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When starting from feature service URL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var sgdb = await ServiceGeodatabase.CreateAsync(featureServiceUrl, FeatureServiceSessionType.Persistent); // specify session mode&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Be sure to call close at the end when done with working on the branch version to release the read/write locks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var parameters = new ServiceVersionParameters()
{
Name = $"VALID_VERSION_{digits}",
Description = versionDescription,
Access = VersionAccess.Private
};
var serviceVersionInfo = await sgdb.CreateVersionAsync(parameters); // create version

await sgdb.SwitchVersionAsync(serviceVersionInfo.Name); // switch

var layer = sgdb.GetTable(serviceLayerId); // all layers/tables

await sgdb.CloseAsync(); // when done&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Opening the same version in ArcGIS Pro or Map Viewer will attempt to acquire read and write locks as well. On the server, there's &lt;A title="Purge Lock" href="https://developers.arcgis.com/rest/services-reference/enterprise/purge-lock/" target="_self"&gt;purge lock&lt;/A&gt; and &lt;A title="Delete " href="https://developers.arcgis.com/rest/services-reference/enterprise/delete/" target="_self"&gt;delete&lt;/A&gt; version that will allow you to cleanup versions that should be released and deleted.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 16:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/branch-versioning-deleting-a-version-cause-the/m-p/1596199#M13392</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2025-03-17T16:58:15Z</dc:date>
    </item>
  </channel>
</rss>

