<?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: How to Set/Un-Set  a Service Lock Database Schema Property Using ArcGIS API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-set-un-set-a-service-lock-database-schema/m-p/1354868#M9340</link>
    <description>&lt;P&gt;This IS possible, but you have to be very careful that you provide the&amp;nbsp;&lt;EM&gt;exact&lt;/EM&gt; JSON representation of your service (plus the update to the "schemaLockingEnabled" property) as a dict. I tested the below with good results, but I suggest you carefully review the service properties for correctness and use a test service to start.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

gis = GIS("https://machine.domain.com/portal", "user", "pass")
hosting_server = gis.admin.servers.get(role="HOSTING_SERVER")[0]
services = hosting_server.services.list()
service = services[0]

# You can get the required dict for the edit from service.properties
# Review for accuracy as this update could break your service if there are
# any errors present
edit_dict = service.properties.__dict__["_mapping"] 
edit_dict["properties"]["schemaLockingEnabled"] = "false"
service.edit(edit_dict)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Nov 2023 20:50:51 GMT</pubDate>
    <dc:creator>EarlMedina</dc:creator>
    <dc:date>2023-11-29T20:50:51Z</dc:date>
    <item>
      <title>How to Set/Un-Set  a Service Lock Database Schema Property Using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-set-un-set-a-service-lock-database-schema/m-p/1354482#M9336</link>
      <description>&lt;P&gt;Can someone please let me know if there is a way that we can set/unset a service &lt;STRONG&gt;Lock Database Schema&lt;/STRONG&gt;&amp;nbsp;by using ArcGIS ArcGIS API for Python&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BHK_0-1701232205662.jpeg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/87407i6248576C21579E5C/image-size/large?v=v2&amp;amp;px=999" role="button" title="BHK_0-1701232205662.jpeg" alt="BHK_0-1701232205662.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 04:33:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-set-un-set-a-service-lock-database-schema/m-p/1354482#M9336</guid>
      <dc:creator>BHK</dc:creator>
      <dc:date>2023-11-29T04:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Set/Un-Set  a Service Lock Database Schema Property Using ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-set-un-set-a-service-lock-database-schema/m-p/1354868#M9340</link>
      <description>&lt;P&gt;This IS possible, but you have to be very careful that you provide the&amp;nbsp;&lt;EM&gt;exact&lt;/EM&gt; JSON representation of your service (plus the update to the "schemaLockingEnabled" property) as a dict. I tested the below with good results, but I suggest you carefully review the service properties for correctness and use a test service to start.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

gis = GIS("https://machine.domain.com/portal", "user", "pass")
hosting_server = gis.admin.servers.get(role="HOSTING_SERVER")[0]
services = hosting_server.services.list()
service = services[0]

# You can get the required dict for the edit from service.properties
# Review for accuracy as this update could break your service if there are
# any errors present
edit_dict = service.properties.__dict__["_mapping"] 
edit_dict["properties"]["schemaLockingEnabled"] = "false"
service.edit(edit_dict)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 20:50:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-set-un-set-a-service-lock-database-schema/m-p/1354868#M9340</guid>
      <dc:creator>EarlMedina</dc:creator>
      <dc:date>2023-11-29T20:50:51Z</dc:date>
    </item>
  </channel>
</rss>

