<?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: GP Tool Using Python for ArcGIS Server - Getting Schema Lock with Simulataneous U in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/gp-tool-using-python-for-arcgis-server-getting/m-p/126545#M9873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I will add that the locator I am using is not coming from SDE.&amp;nbsp; It is a standalone locator that pull data from SDE.&amp;nbsp; Could that be the issue?&amp;nbsp; Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# 1. Import arcpy module import arcpy, os, sys, datetime from arcpy import env&amp;nbsp; # 2. Set geoprocessing environment scratch = arcpy.env.scratchWorkspace arcpy.env.scratchWorkspace = r"E:\geoprocessing\Building\Outputworkspace" arcpy.env.overwriteOutput = True&amp;nbsp; # 3. Specify Date and Time now = datetime.datetime.now()&amp;nbsp; # 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)&amp;nbsp; # 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)&amp;nbsp; # 6. Make Query Table and Copy Rows if Result is greater than 0 arcpy.AddMessage("Selecting scheduled inspections...")&amp;nbsp; arcpy.MakeQueryTable_management(sde_sdegis_VCOE_CRWINSPECTIONLOG, CRWInspectionLog, "NO_KEY_FIELD", "", "", Xpression)&amp;nbsp; 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, "")&amp;nbsp; del CRWInspectionLog&amp;nbsp; # 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.")&amp;nbsp; # 8. Scheduled Inspections Output arcpy.SetParameterAsText(2, ScheduledInspections)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 May 2014 13:20:20 GMT</pubDate>
    <dc:creator>IanPeebles</dc:creator>
    <dc:date>2014-05-26T13:20:20Z</dc:date>
    <item>
      <title>GP Tool Using Python for ArcGIS Server - Getting Schema Lock with Simulataneous Usage</title>
      <link>https://community.esri.com/t5/python-questions/gp-tool-using-python-for-arcgis-server-getting/m-p/126544#M9872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a question.&amp;nbsp; I have created a python tool that has two input parameters.&amp;nbsp; These parameters include (input initials) and (input date).&amp;nbsp; 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.&amp;nbsp; 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?&amp;nbsp; The weird thing is that this tool worked before.&amp;nbsp; 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.&amp;nbsp; Why would I get a schema lock?&amp;nbsp; How can I use the address locator without getting a schema lock when multiple users are hitting GP service.&amp;nbsp; Any help will greatly be appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 May 2014 00:38:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gp-tool-using-python-for-arcgis-server-getting/m-p/126544#M9872</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2014-05-24T00:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool Using Python for ArcGIS Server - Getting Schema Lock with Simulataneous U</title>
      <link>https://community.esri.com/t5/python-questions/gp-tool-using-python-for-arcgis-server-getting/m-p/126545#M9873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I will add that the locator I am using is not coming from SDE.&amp;nbsp; It is a standalone locator that pull data from SDE.&amp;nbsp; Could that be the issue?&amp;nbsp; Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# 1. Import arcpy module import arcpy, os, sys, datetime from arcpy import env&amp;nbsp; # 2. Set geoprocessing environment scratch = arcpy.env.scratchWorkspace arcpy.env.scratchWorkspace = r"E:\geoprocessing\Building\Outputworkspace" arcpy.env.overwriteOutput = True&amp;nbsp; # 3. Specify Date and Time now = datetime.datetime.now()&amp;nbsp; # 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)&amp;nbsp; # 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)&amp;nbsp; # 6. Make Query Table and Copy Rows if Result is greater than 0 arcpy.AddMessage("Selecting scheduled inspections...")&amp;nbsp; arcpy.MakeQueryTable_management(sde_sdegis_VCOE_CRWINSPECTIONLOG, CRWInspectionLog, "NO_KEY_FIELD", "", "", Xpression)&amp;nbsp; 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, "")&amp;nbsp; del CRWInspectionLog&amp;nbsp; # 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.")&amp;nbsp; # 8. Scheduled Inspections Output arcpy.SetParameterAsText(2, ScheduledInspections)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 13:20:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/gp-tool-using-python-for-arcgis-server-getting/m-p/126545#M9873</guid>
      <dc:creator>IanPeebles</dc:creator>
      <dc:date>2014-05-26T13:20:20Z</dc:date>
    </item>
  </channel>
</rss>

