<?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: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service. in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1488515#M84405</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/682308"&gt;@mazzouzi&lt;/a&gt;&amp;nbsp;et al,&lt;/P&gt;&lt;P&gt;That code worked for me.&amp;nbsp; Thank you.&amp;nbsp; Is there a way to be more surgical? This operates on the entire geodatabase where ArcGIS Pro client manually operates locks at the table level.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2024 21:10:57 GMT</pubDate>
    <dc:creator>TylerT</dc:creator>
    <dc:date>2024-06-10T21:10:57Z</dc:date>
    <item>
      <title>000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1368519#M77219</link>
      <description>&lt;P&gt;If you are encountering the error "Either being edited or in use by another application or service" in ArcGIS when working with a geodatabase file, it typically indicates that the geodatabase is locked by another process or user. This can happen when a dataset within the geodatabase is being edited or when there's a lingering lock from a previous operation.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you can use the "&lt;/SPAN&gt;arcpy.da.Editor"&lt;SPAN&gt; class in ArcPy. This class provides a way to manage edit sessions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here's an example script that stops the current editing session:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

def stop_editing(workspace):
    try:
        # Create an edit session
        edit = arcpy.da.Editor(workspace)

        # Stop the edit session
        edit.stopEditing(True)  # The True parameter saves the edits

        print("Editing session stopped successfully.")

    except Exception as e:
        print("Error stopping editing session: {}".format(str(e)))

# Specify the path to your geodatabase file
geodatabase_path = r"C:\Path\to\YourGeodatabase.gdb"

# Call the function to stop editing
stop_editing(geodatabase_path)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Replace &lt;/SPAN&gt;"C:\Path\to\YourGeodatabase.gdb"&lt;SPAN&gt; with the actual path to your geodatabase file. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 19:04:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1368519#M77219</guid>
      <dc:creator>mazzouzi</dc:creator>
      <dc:date>2024-01-10T19:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1420677#M82999</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/682308"&gt;@mazzouzi&lt;/a&gt;&amp;nbsp;et al,&lt;/P&gt;&lt;P&gt;I am getting this exact error regularly on Enterprise Geodatabase sde path vice gdb file.&amp;nbsp; I can't get the arcpy.da.Editor stopEditing script above working on the Enterprise workspace, and it's not clear to me whether it should work in the Enterprise environment.&amp;nbsp; Should&amp;nbsp;arcpy.da.Editor(workspace) stopEditing work on an Enterprise Geodatabase and if not, how can I programmatically release locks and connections on feature classes.&amp;nbsp; For now, I have been using ArcGIS Pro GUI to release the endless locks and connections, but it's time consuming.&lt;BR /&gt;&lt;BR /&gt;Thank you,&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 20:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1420677#M82999</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-05-08T20:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1479625#M83851</link>
      <description>&lt;LI-CODE lang="c"&gt;import arcpy

def stop_editing(workspace):
    try:
        # Create an edit session
        edit = arcpy.da.Editor(workspace)

        # Stop the edit session
        edit.stopEditing(True)  # The True parameter saves the edits

        print("Editing session stopped successfully.")

    except Exception as e:
        print("Error stopping editing session: {}".format(str(e)))

def disconnect_users(workspace):
    try:
        # Disconnect all users from the SDE geodatabase
        arcpy.DisconnectUser(workspace, "ALL")

        print("All users disconnected successfully.")

    except Exception as e:
        print("Error disconnecting users: {}".format(str(e)))

def remove_locks(workspace):
    try:
        # Remove all locks from the SDE geodatabase
        arcpy.ClearWorkspaceCache_management(workspace)

        print("All locks removed successfully.")

    except Exception as e:
        print("Error removing locks: {}".format(str(e)))

# Specify the path to your SDE geodatabase
sde_geodatabase_path = r"Database Connections\YourSDEConnection.sde"

# Call the function to stop editing
stop_editing(sde_geodatabase_path)

# Call the function to disconnect users
disconnect_users(sde_geodatabase_path)

# Call the function to remove locks
remove_locks(sde_geodatabase_path)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 May 2024 16:29:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1479625#M83851</guid>
      <dc:creator>mazzouzi</dc:creator>
      <dc:date>2024-05-28T16:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1479627#M83853</link>
      <description>&lt;P&gt;try this code may work for you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 16:29:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1479627#M83853</guid>
      <dc:creator>mazzouzi</dc:creator>
      <dc:date>2024-05-28T16:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1480079#M83910</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp; I will give this a go, and let you know.&amp;nbsp; Tyler&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2024 11:23:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1480079#M83910</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-05-29T11:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1488515#M84405</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/682308"&gt;@mazzouzi&lt;/a&gt;&amp;nbsp;et al,&lt;/P&gt;&lt;P&gt;That code worked for me.&amp;nbsp; Thank you.&amp;nbsp; Is there a way to be more surgical? This operates on the entire geodatabase where ArcGIS Pro client manually operates locks at the table level.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tyler&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 21:10:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1488515#M84405</guid>
      <dc:creator>TylerT</dc:creator>
      <dc:date>2024-06-10T21:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: 000464: Cannot get exclusive schema lock. Either being edited or in use by another application or service.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1599552#M94377</link>
      <description>&lt;P&gt;I have a Toolbox Script, where would I insert my script into the solution code?&lt;/P&gt;&lt;P&gt;Like how a black Toolbox Script will show where to insert one's custom code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="eallan_1-1743010345158.png" style="width: 759px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/128758iDB2DD5C4E7262B7C/image-dimensions/759x643?v=v2" width="759" height="643" role="button" title="eallan_1-1743010345158.png" alt="eallan_1-1743010345158.png" /&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, 26 Mar 2025 17:32:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/000464-cannot-get-exclusive-schema-lock-either/m-p/1599552#M94377</guid>
      <dc:creator>eallan</dc:creator>
      <dc:date>2025-03-26T17:32:54Z</dc:date>
    </item>
  </channel>
</rss>

