<?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: Publishing a layer creates lock and my python script cannot replace the feature class in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114239#M31483</link>
    <description>&lt;P&gt;Hi Shital,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am fairly new to python myself.&amp;nbsp; I did find a tutorial on YouTube that really helped.&amp;nbsp;&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=NfnBLGLRb7Q" target="_blank"&gt;https://www.youtube.com/watch?v=NfnBLGLRb7Q&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I also found making a view of my feature layer to share with the public helped once it's published.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 18:57:34 GMT</pubDate>
    <dc:creator>RyanBohan</dc:creator>
    <dc:date>2021-11-04T18:57:34Z</dc:date>
    <item>
      <title>Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114229#M31481</link>
      <description>&lt;P&gt;Hello, I get a fresh csv every morning that I geocode and publish as a feature layer to be consumed in a dashboard. Now when I use python script to automate the workflow every morning, I see a lock from my ArcGIS Server service account. This lock (probably) doesn't let the python to overwrite the feature and a result, the new feature class that gets created appears in UPPER CASE and as a stand alone layer (not inside feature dataset). From second time around, the script just fails because either it couldn't overwrite the feature class or because it thinks there is already a feature class with that name inside the enterprise geodatabase.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, basically how can I overwrite a feature class that is published and hence has a lock from service account using python?&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 18:49:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114229#M31481</guid>
      <dc:creator>al_Dhakal</dc:creator>
      <dc:date>2021-11-04T18:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114236#M31482</link>
      <description>&lt;P&gt;Assuming your data is not on the c: you can change the permissions of the server service account to read only. &amp;nbsp;Then it can’t create locks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 18:53:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114236#M31482</guid>
      <dc:creator>Scott_Tansley</dc:creator>
      <dc:date>2021-11-04T18:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114239#M31483</link>
      <description>&lt;P&gt;Hi Shital,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am fairly new to python myself.&amp;nbsp; I did find a tutorial on YouTube that really helped.&amp;nbsp;&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=NfnBLGLRb7Q" target="_blank"&gt;https://www.youtube.com/watch?v=NfnBLGLRb7Q&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I also found making a view of my feature layer to share with the public helped once it's published.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 18:57:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114239#M31483</guid>
      <dc:creator>RyanBohan</dc:creator>
      <dc:date>2021-11-04T18:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114249#M31485</link>
      <description>&lt;P&gt;It all depends on how you have it set up but a truncate and load will work even with locks.&amp;nbsp; Keep the existing table and just replace the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 19:08:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114249#M31485</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-11-04T19:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114371#M31498</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/44627"&gt;@al_Dhakal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;instead of republishing the service every time you get new data, you can use the feature access capability to update the service features.&amp;nbsp;&lt;BR /&gt;I would recommend having a look into this tutorial, implementing almost exactly what you are after:&lt;/P&gt;&lt;P&gt;Append attribute values from a CSV into a new column on a Feature Layer&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/python/guide/appending-features/#Append-attribute-values-from-a-CSV-to-a-Feature-Layer" target="_blank"&gt;https://developers.arcgis.com/python/guide/appending-features/#Append-attribute-values-from-a-CSV-to-a-Feature-Layer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Ihab&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 01:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114371#M31498</guid>
      <dc:creator>IhabHassan</dc:creator>
      <dc:date>2021-11-05T01:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114374#M31499</link>
      <description>&lt;P&gt;Alternative approach, while still using the service, is to use API for Python arcgis.features.FeatureLayer module, either using the "append" or "edit_features" methods, as explained here:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#featurelayer" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#featurelayer&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 01:16:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114374#M31499</guid>
      <dc:creator>IhabHassan</dc:creator>
      <dc:date>2021-11-05T01:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114617#M31514</link>
      <description>&lt;P&gt;Thanks but I have other services that need write access to be editable on Collector app or through browser.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114617#M31514</guid>
      <dc:creator>al_Dhakal</dc:creator>
      <dc:date>2021-11-05T19:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114618#M31515</link>
      <description>&lt;P&gt;Thank you. Append might not work for what I am trying to do because I want to add all the records every morning and delete all the records from the previous day.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114618#M31515</guid>
      <dc:creator>al_Dhakal</dc:creator>
      <dc:date>2021-11-05T19:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114619#M31516</link>
      <description>&lt;P&gt;Thank you. I will look into this. Although mine is not a hosted layer. It's a feature layer published through federated server so that the layer is always in sync with the enterprise geodatabase.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114619#M31516</guid>
      <dc:creator>al_Dhakal</dc:creator>
      <dc:date>2021-11-05T19:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114620#M31517</link>
      <description>&lt;P&gt;I will look into this, thank you. I am also trying to see if creating a 'database view' and publishing the view layer might release lock from my actual feature class.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 19:13:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114620#M31517</guid>
      <dc:creator>al_Dhakal</dc:creator>
      <dc:date>2021-11-05T19:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114705#M31521</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/44627"&gt;@al_Dhakal&lt;/a&gt;, I have faced a similar problem relating to the loading of data with locks occurring from the AGS.&lt;BR /&gt;&lt;BR /&gt;My method around this, taking into account the client-specific workflow, was to stop the required service on AGS using python which releases the lock, load the data, and then restart the service.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Nov 2021 04:48:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1114705#M31521</guid>
      <dc:creator>CamMuller</dc:creator>
      <dc:date>2021-11-06T04:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing a layer creates lock and my python script cannot replace the feature class</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1116722#M31574</link>
      <description>&lt;P&gt;Hi all, thank you for all the suggestions. The easier solution that worked for my (as of now) is to use the database view and publish the view layer instead. This way, there is a lock established on the view feature class only and I can use python scripts to overwrite the original feature class. More on the database view here -&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-database-view.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-database-view.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 02:28:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/publishing-a-layer-creates-lock-and-my-python/m-p/1116722#M31574</guid>
      <dc:creator>al_Dhakal</dc:creator>
      <dc:date>2021-11-15T02:28:40Z</dc:date>
    </item>
  </channel>
</rss>

