Select to view content in your preferred language

ArcGIS Pro freezes attempting to connect to SDE

1622
11
03-20-2020 02:12 PM
DavidLaMartina
New Contributor III

We're creating an Arc Pro extension that allows users to create database connections to various file types, including GDB and SDE. Below is the code used to create a Geodatabase object out of an SDE connection. This works most of the time.

However, there is a case when this does not work, and ArcGIS Pro completely freezes up and eventually crashes. If I create a connection in the Catalog to a SQL database, that automatically creates an SDE. We need the SDE to access spatial data, so we take that SDE file path and use it to create a Geodatabase object using the code above.

If the "save password" option was not selected when the SQL connection was created, we get the freeze and crash. It makes sense that we would not be able to connect in this case, but wouldn't this crash be considered a bug?

Tags (2)
0 Kudos
11 Replies
GKmieliauskas
Esri Regular Contributor

Hi all,

We are facing the same issue with ArcGIS Pro 3.0.2. What about you?

0 Kudos
GKmieliauskas
Esri Regular Contributor

Hi,

I would like to share Esri answer related to our problems described above:

"It seems the issue related to the deadlock. since the below code snippet:

protected override void OnClick()

{bool ret = QueuedTask.Run(() =>{}).Result;}, as they will be blocking the UI thread.

  • Based on the code snippet: The top-level method synchronously blocks on the Task returned by queueTaskRun. This blocks the context thread.
  • Deadlock occurs. The top-level method is blocking the context thread, waiting for Geodatabase to complete, and bool ret = QueuedTask.Run(() =>{} is waiting for the context to be free so it can complete.

Hope below two doc links helpful:

Using QueuedTask.Run without Results works fine.

0 Kudos