<?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 GP Tool - Schema Locking Error with Geocoding Process in ArcGIS Enterprise Questions</title>
    <link>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570872#M22032</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a question. I have created a python tool that has two input parameters. These parameters include (input initials) and (input date). After these parameters are entered in the tool runs and maps building inspections. The output results show a colored point wiwith the matching colored label based on the input initials. The tool runs fine in desktop and publishes to ArcGIS Server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcGIS Server, the tool runs well, but when another user runs the tool simultaneously, both user get schema locks in regards to the geocoding service causing the tool to fail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I prevent these schema locks? The weird thing is that this tool worked before. I am running ArcGIS Server 10.1 SP1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is how my locator is called out within the tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AddressesWithBldgNo = r"e:\locators\AddressesWithBldgNo"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;scratch workspace is set when I run the tool = e:\outputworkspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a share set up. Why would I get a schema lock? How can I use the address locator without getting a schema lock when multiple users are hitting GP service. Any help will greatly be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a screenshot of the error message I am getting in the Silverlight Application.[ATTACH=CONFIG]34071[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 25 May 2014 19:06:11 GMT</pubDate>
    <dc:creator>IanPeebles</dc:creator>
    <dc:date>2014-05-25T19:06:11Z</dc:date>
    <item>
      <title>GP Tool - Schema Locking Error with Geocoding Process</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570872#M22032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a question. I have created a python tool that has two input parameters. These parameters include (input initials) and (input date). After these parameters are entered in the tool runs and maps building inspections. The output results show a colored point wiwith the matching colored label based on the input initials. The tool runs fine in desktop and publishes to ArcGIS Server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In ArcGIS Server, the tool runs well, but when another user runs the tool simultaneously, both user get schema locks in regards to the geocoding service causing the tool to fail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I prevent these schema locks? The weird thing is that this tool worked before. I am running ArcGIS Server 10.1 SP1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is how my locator is called out within the tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AddressesWithBldgNo = r"e:\locators\AddressesWithBldgNo"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;scratch workspace is set when I run the tool = e:\outputworkspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a share set up. Why would I get a schema lock? How can I use the address locator without getting a schema lock when multiple users are hitting GP service. Any help will greatly be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a screenshot of the error message I am getting in the Silverlight Application.[ATTACH=CONFIG]34071[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 25 May 2014 19:06:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570872#M22032</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2014-05-25T19:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool - Schema Locking Error with Geocoding Process</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570873#M22033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When running a GP service on the server, the scratch workspace is created under a job directory. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
http://[server]/arcgis/rest/directories/arcgisjobs/lotexport_gpserver/j52e4e3ec1ff741e9aad19b8263615232/scratch/WebMap_12345.pdf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Job ID)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your script may be overriding this and attempting to use the same scratch workspace for simultaneous users - leading to the schema lock.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The code that produced the URL result above just uses the scratchFolder as the directory in which to create the PDF file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fn = 'WebMap_{0}.pdf'.format(str(id))
out_fn = os.path.join(arcpy.env.scratchFolder, output)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you create your temporary data in the arcpy.env.scratchFolder then the server should create unique datasets and avoid any schema locks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Owen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:33:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570873#M22033</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2021-12-12T00:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool - Schema Locking Error with Geocoding Process</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570874#M22034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;When running a GP service on the server, the scratch workspace is created under a job directory. For example:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
http://[server]/arcgis/rest/directories/arcgisjobs/lotexport_gpserver/j52e4e3ec1ff741e9aad19b8263615232/scratch/WebMap_12345.pdf
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ^
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (Job ID)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Your script may be overriding this and attempting to use the same scratch workspace for simultaneous users - leading to the schema lock.&lt;BR /&gt;&lt;BR /&gt;The code that produced the URL result above just uses the scratchFolder as the directory in which to create the PDF file:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;fn = 'WebMap_{0}.pdf'.format(str(id))
out_fn = os.path.join(arcpy.env.scratchFolder, output)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;If you create your temporary data in the arcpy.env.scratchFolder then the server should create unique datasets and avoid any schema locks.&lt;BR /&gt;&lt;BR /&gt;Owen&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was also thinking, the locator I am using is not in SDE.&amp;nbsp; It is a standalone locator that pulls data from SDE.&amp;nbsp; Could that be part f the problem? Should I point to the locator from SDE rather than a standalone locator on the server?&amp;nbsp; Here is my code. What would need to be changed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# 1. Import arcpy module
import arcpy, os, sys, datetime
from arcpy import env

# 2. Set geoprocessing environment
scratch = arcpy.env.scratchWorkspace
arcpy.env.scratchWorkspace = r"E:\geoprocessing\Building\Outputworkspace"
arcpy.env.overwriteOutput = True

# 3. Specify Date and Time
now = datetime.datetime.now()

# 4. Input Parameters
Initials = arcpy.GetParameterAsText(0)
InspDate = arcpy.GetParameterAsText(1)
if InspDate == "":
&amp;nbsp;&amp;nbsp; InspDate = now.strftime("%m-%d-%y") #This will return today's date.
arcpy.AddMessage("Searching for scheduled inspections...")
Xpression = """ "INSPECTOR" = \'%s\' AND "SCHEDULED_DATE" = \'%s\' """ % (Initials, InspDate)

# 5. Local variables:
sde_sdegis_VCOE_CRWINSPECTIONLOG = r"e:\connections\AGSGIS_TO_SDEGIS_COE.sde\\sde.sdegis.VCOE_CRWINSPECTIONLOG"
CRWInspectionLog = "CRWInspectionLog"
CRWInspectionLogCopyRows = os.path.join(scratch,CRWInspectionLogCopyRows.dbf)
AddressesWithBldgno = r"e:\locators\\AddressesWithBldgNo"
ScheduledInspections = os.path.join(ScheduledInspections.shp)

# 6. Make Query Table and Copy Rows if Result is greater than 0
arcpy.AddMessage("Selecting scheduled inspections...")

arcpy.MakeQueryTable_management(sde_sdegis_VCOE_CRWINSPECTIONLOG, CRWInspectionLog, "NO_KEY_FIELD", "", "", Xpression)

result = int(arcpy.GetCount_management(CRWInspectionLog).getOutput(0))
arcpy.AddMessage("Inspections Found: " + str(result))
if result == 0:
&amp;nbsp;&amp;nbsp; arcpy.AddWarning("Process terminated."); sys.exit()
else:
&amp;nbsp;&amp;nbsp; arcpy.CopyRows_management(CRWInspectionLog, CRWInspectionLogCopyRows, "")

del CRWInspectionLog

# 7. Geocode Inspections
arcpy.AddMessage("Geocoding inspections, please wait...")
arcpy.GeocodeAddresses_geocoding(CRWInspectionLogCopyRows, AddressesWithBldgno, Street SITE_ADDR VISIBLE NONE;City &amp;lt;None&amp;gt; VISIBLE NONE, ScheduledInspections, "STATIC")
result1 = int(arcpy.GetCount_management(ScheduledInspections).getOutput(0))
arcpy.AddMessage("Inspections Geocoded: " + str(result1))
if result1 &amp;lt; result:
&amp;nbsp;&amp;nbsp; arcpy.AddWarning("Not all inspections were mapped.")
else:
&amp;nbsp;&amp;nbsp; arcpy.AddMessage("All inspections mapped.")

# 8. Scheduled Inspections Output
arcpy.SetParameterAsText(2, ScheduledInspections)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How would I add in your code to stop the schema lock?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570874#M22034</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2021-12-12T00:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool - Schema Locking Error with Geocoding Process</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570875#M22035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't think the issue is with the locator, it looks like the schema lock is happening when the second process attempts to copy rows to the DBF file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;CRWInspectionLogCopyRows = os.path.join(scratch,CRWInspectionLogCopyRows.dbf) ... if result == 0: &amp;nbsp;&amp;nbsp; arcpy.AddWarning("Process terminated."); sys.exit() else: &amp;nbsp;&amp;nbsp; # The next line is probably the cause of the schema lock: &amp;nbsp;&amp;nbsp; arcpy.CopyRows_management(CRWInspectionLog, CRWInspectionLogCopyRows, "")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The DBF file will be locked by the first process and the second process will not be able to write to the same file while it is open. In your script this file would be the same for all users:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;E:\geoprocessing\Building\Outputworkspace\CRWInspectionLogCopyRows.dbf &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To avoid this on the server you should remove the line that specifically sets the scratchWorkspace:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# 2. Set geoprocessing environment scratch = arcpy.env.scratchWorkspace arcpy.env.scratchWorkspace = r"E:\geoprocessing\Building\Outputworkspace" # - REMOVE this line arcpy.env.overwriteOutput = True&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Change to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# 2. Set geoprocessing environment scratch = arcpy.env.scratchFolder arcpy.env.overwriteOutput = True&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then when simultaneous users run the script they each get a system generated job/scratch directory and the DBF files can be created without any locking issues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alternatively, you could use some random temp file name for each DBF if you want to keep your specific scratchWorkspace. This way each process is writing to a different DBF file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Owen&lt;/SPAN&gt;&lt;BR /&gt;&lt;A _jive_internal="true" class="" href="https://community.esri.com/www.spatialxp.com.au"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 22:28:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570875#M22035</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-05-26T22:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool - Schema Locking Error with Geocoding Process</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570876#M22036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I don't think the issue is with the locator, it looks like the schema lock is happening when the second process attempts to copy rows to the DBF file:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;CRWInspectionLogCopyRows = os.path.join(scratch,CRWInspectionLogCopyRows.dbf)
...
if result == 0:
&amp;nbsp;&amp;nbsp; arcpy.AddWarning("Process terminated."); sys.exit()
else:
&amp;nbsp;&amp;nbsp; # The next line is probably the cause of the schema lock:
&amp;nbsp;&amp;nbsp; arcpy.CopyRows_management(CRWInspectionLog, CRWInspectionLogCopyRows, "")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;The DBF file will be locked by the first process and the second process will not be able to write to the same file while it is open. In your script this file would be the same for all users:&lt;BR /&gt;&lt;BR /&gt;E:\geoprocessing\Building\Outputworkspace\CRWInspectionLogCopyRows.dbf &lt;BR /&gt;&lt;BR /&gt;To avoid this on the server you should remove the line that specifically sets the scratchWorkspace:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# 2. Set geoprocessing environment
scratch = arcpy.env.scratchWorkspace
arcpy.env.scratchWorkspace = r"E:\geoprocessing\Building\Outputworkspace" # - REMOVE this line
arcpy.env.overwriteOutput = True&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Change to:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# 2. Set geoprocessing environment
scratch = arcpy.env.scratchFolder
arcpy.env.overwriteOutput = True&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Then when simultaneous users run the script they each get a system generated job/scratch directory and the DBF files can be created without any locking issues.&lt;BR /&gt;&lt;BR /&gt;Alternatively, you could use some random temp file name for each DBF if you want to keep your specific scratchWorkspace. This way each process is writing to a different DBF file.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Owen&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.esri.com/www.spatialxp.com.au" target="_blank"&gt;www.spatialxp.com.au&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Owen, so you think removing the second line will solve the issue?&amp;nbsp; This tool worked before.&amp;nbsp; When I first run the tool in ArcGIS Desktop, I don't need to set a scratch workspace?&amp;nbsp; Everything else looks correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The output references a layer file on the e drive.&amp;nbsp; That should be acceptable correct?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:33:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570876#M22036</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2021-12-12T00:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool - Schema Locking Error with Geocoding Process</title>
      <link>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570877#M22037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Owen,&amp;nbsp; your support solved my issue.&amp;nbsp; Thank you very much!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2014 12:21:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-enterprise-questions/gp-tool-schema-locking-error-with-geocoding/m-p/570877#M22037</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2014-05-27T12:21:10Z</dc:date>
    </item>
  </channel>
</rss>

