<?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: Geodatabase constructor hangs with organziation URL in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1329783#M10412</link>
    <description>&lt;P&gt;Properly adding an async from our UI to this method would be a very difficult task.&lt;/P&gt;&lt;P&gt;Is there a way to check if I am currently signed into ArcGIS portal before attempting to call the Geodatabase constructor?&lt;/P&gt;</description>
    <pubDate>Mon, 18 Sep 2023 19:10:22 GMT</pubDate>
    <dc:creator>KarlBeal</dc:creator>
    <dc:date>2023-09-18T19:10:22Z</dc:date>
    <item>
      <title>Geodatabase constructor hangs with organziation URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1314112#M10125</link>
      <description>&lt;P&gt;I created a feature layer in my ArcGIS Online organization. The URL looks like: &lt;A href="https://services7.arcgis.com/" target="_blank"&gt;https://services7.arcgis.com/&lt;/A&gt;&amp;lt;unique string&amp;gt;/arcgis/rest/services/Test_Feature_Layer/FeatureServer&lt;/P&gt;&lt;P&gt;If I sign out of the licensing portal in ArcGIS Pro and then run the code shown below with my URL, it will freeze at the constructor on line 9.&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I avoid this frozen state?&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public bool TestConnection(string url)
{
    return RunMCTOnNonGUIThread(() =&amp;gt;
    {
        Geodatabase gdb = null;
        try
        {
            var service = new ServiceConnectionProperties(new Uri(url));
            gdb = new Geodatabase(service);
            return true;
        }
        catch
        {
            return false;
        }
        finally
        {
            gdb?.Dispose();
        }
    });
}

private T RunMCTOnNonGUIThread&amp;lt;T&amp;gt;(Func&amp;lt;T&amp;gt; function)
    =&amp;gt; Task.Run(() =&amp;gt; QueuedTask.Run(function)).Result;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 15:57:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1314112#M10125</guid>
      <dc:creator>KarlBeal</dc:creator>
      <dc:date>2023-08-01T15:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Geodatabase constructor hangs with organziation URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1314410#M10126</link>
      <description>&lt;P&gt;try this:&amp;nbsp; - Your utility method is likely causing a deadlock. u dont need the extra Task wrapper around the QueuedTask. Also, using Task.Result should be avoided (as it can cause deadlocks).&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public Task&amp;lt;bool&amp;gt; TestConnectionAsync(string url)
{
   return QueuedTask.Run(() =&amp;gt;
   {
     try
     {
     var service = new ServiceConnectionProperties(new Uri(url));
     using (var gdb = new Geodatabase(service))
       return true;
     }
     catch
     {
       return false;
     }
  });
}
//usage
var connect_ok = await TestConnectionAsync("connection_string");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 00:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1314410#M10126</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2023-08-02T00:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Geodatabase constructor hangs with organziation URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1316105#M10154</link>
      <description>&lt;P&gt;Thanks for the info. I am not going to be able to verify if this is the solution for a while.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2023 16:56:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1316105#M10154</guid>
      <dc:creator>KarlBeal</dc:creator>
      <dc:date>2023-08-07T16:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Geodatabase constructor hangs with organziation URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1329783#M10412</link>
      <description>&lt;P&gt;Properly adding an async from our UI to this method would be a very difficult task.&lt;/P&gt;&lt;P&gt;Is there a way to check if I am currently signed into ArcGIS portal before attempting to call the Geodatabase constructor?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 19:10:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1329783#M10412</guid>
      <dc:creator>KarlBeal</dc:creator>
      <dc:date>2023-09-18T19:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Geodatabase constructor hangs with organziation URL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1329829#M10413</link>
      <description>&lt;P&gt;not from the UI. At some point u have to go onto the QueuedTask.&lt;/P&gt;&lt;P&gt;Once on the QueuedTask u can call&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic14679.html" target="_blank" rel="noopener"&gt;ArcGISPortal IsSignedOn()&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 20:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geodatabase-constructor-hangs-with-organziation/m-p/1329829#M10413</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2023-09-18T20:15:30Z</dc:date>
    </item>
  </channel>
</rss>

