1

I have created a Flow to update the GUID(the unique identifier of CDS entity records) into an SQL Server table From CDS whenever a new record is created in CDS. The flow is working fine If I create records one by one. But If I import multiple records(around 3000 records) from SQL to CDS using Dataflows, then I am getting the below deadlock error in Flows.

"Transaction (Process ID 74) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction."

The dataflow refreshes the data on a scheduled basis. So, I could not resubmit the failed runs every time.

How to get rid of this deadlock issue? Or Is there any other approaches to update the SQL table in an efficient way?

I tried options like the degree of parallelism(10 records), retry policy. But no use. If I reduce the parallelly running records to 1, then it is running slowly and taking more than 1h for updating 1000 records.

4

2 回答 2

0

如果您的查询是deadlock受害者,您可以创建扩展事件会话来捕获有关此事件的详细信息。然后,有了死锁图,您将找到问题的真正原因。

该图将准确地向您显示导致它的资源锁和涉及的语句是什么。

于 2020-10-13T06:28:53.713 回答
0

您可以尝试更改与您连接的事务的隔离级别

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

了解更多 https://docs.microsoft.com/en-us/sql/connect/jdbc/understanding-isolation-levels?view=sql-server-ver15

于 2020-10-13T07:44:10.880 回答