<?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: ArcGIS Server - Define a default workspace for every service instances in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285656#M22065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's interesting! I'll try using layers as input rather than paths to datasets&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Aug 2018 19:43:56 GMT</pubDate>
    <dc:creator>MaximeDemers</dc:creator>
    <dc:date>2018-08-31T19:43:56Z</dc:date>
    <item>
      <title>ArcGIS Server - Define a default workspace for every service instances</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285654#M22063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some geoprocessing services published to ArcGIS Server. I have noticed that every time a request is made, a great amount of time (1 to 3 seconds) is needed to establish the connection to the Geodatabase Entreprise workspace.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, if I use a SearchCursor in a GP Service, a lot of time is spent setting arcpy.env.workspace. It's not faster to define the workspace in the SearchCursor in_table parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know if it's possible to define a default workspace at the service instances level in order that when a service instance is created, the connection to a Geodatabase Entreprise workspace is made and kept open until the instance is closed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2018 18:14:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285654#M22063</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2018-08-07T18:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Server - Define a default workspace for every service instances</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285655#M22064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may help? -&amp;nbsp;&lt;A class="link-titled" href="https://enterprise.arcgis.com/en/server/10.5/publish-services/windows/performance-tips-for-geoprocessing-services.htm#GUID-194031A1-849A-48A6-B81D-81CDF5644B9A" title="https://enterprise.arcgis.com/en/server/10.5/publish-services/windows/performance-tips-for-geoprocessing-services.htm#GUID-194031A1-849A-48A6-B81D-81CDF5644B9A"&gt;Performance tips for geoprocessing services—Documentation | ArcGIS Enterprise&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The bit about "Use layers for project data"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 19:33:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285655#M22064</guid>
      <dc:creator>MatthewLofgren</dc:creator>
      <dc:date>2018-08-31T19:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Server - Define a default workspace for every service instances</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285656#M22065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's interesting! I'll try using layers as input rather than paths to datasets&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2018 19:43:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285656#M22065</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2018-08-31T19:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Server - Define a default workspace for every service instances</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285657#M22066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After some testing, I confirm that using layer (.lyr) as the &lt;STRONG&gt;in_table&lt;/STRONG&gt; parameter in arcpy.da.SearchCursor is much faster than using the path to the feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, to be able to use fields name tokens such SHAPE@ or &lt;A href="mailto:SHAPE@JSON" rel="nofollow noopener noreferrer" target="_blank"&gt;SHAPE@JSON&lt;/A&gt; you have to create a new layer class with the arcpy.mapping module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;layer_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"c:\\temp\\myLayer.lyr"&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapping&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Layer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layer_path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; row&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:48:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285657#M22066</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-12-11T13:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Server - Define a default workspace for every service instances</title>
      <link>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285658#M22067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to give you a thumb up as none of ESRI's doc or webinar I have searched gave a clear example of how to use Layer as the input, because there're some many definition/interpolation of what a Layer is, not to mention have to convert it to Layer class using arcpy.mapping to in order to use the field tokens. thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Apr 2020 22:29:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcgis-server-define-a-default-workspace-for-every/m-p/285658#M22067</guid>
      <dc:creator>Jack_Zhang</dc:creator>
      <dc:date>2020-04-02T22:29:53Z</dc:date>
    </item>
  </channel>
</rss>

