Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Logic app issue - Deadlock when writing a record

(0) ShareShare
ReportReport
Posted on by 9

I have a Logic App that reads data from an Azure SQL table and creates a GL Journal in D365.   This works 90% of the time but every once and a while (a couple times a week) one of the entries in the journal lines will fail with this error:

 

An error has occurred.  Write failed for table row of type 'LedgerJournalLineEntity'. Infolog: Info: Cannot create a record in Journal lines (LedgerJournalTrans). Journal batch number: JBN0018064, ARR000140052.\nDeadlock, where one or more users have simultaneously locked the whole table or part of it.
 
The rest of the lines before and after the failed record write just fine.
I have tried playing with the Concurrency control (setting it to 1) but that did not help.  Someone suggested that if I included the line number in my supplied values it would fix this but I cannot figure out how to do that (it is not one of the fields available, and even if I go into code view and try it says it is not a field that can be populated).  Thanks.
  • MarkGilbert Profile Picture
    9 on at
    Re: Logic app issue - Deadlock when writing a recordSc

    I think I am going to call this resolved. I was looking back and it has only failed one time in the last month (ever since I set the concurrency to 1).   I think when that fail happened I assumed that the concurrency did not help but it looks like it did. I will just chalk that one fail up to a fluke.   If it starts happening regularly again I will submit another post.  Thank you.

     
  • Verified answer
    v-alzhan-msft Profile Picture
    on at
    Re: Logic app issue - Deadlock when writing a record

    Hi @MarkGilbert ,

     

    Could you please share the screenshot of the flow?

    Could you please make sure that you don't have any other flow would run at the same time to lock the table?

     If not, I suggest that you could contact Microsoft for any help on this issue.

     

    Best regards,

    Alice   

    Community Support Team _ Alice Zhang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • MarkGilbert Profile Picture
    9 on at
    Re: Logic app issue - Deadlock when writing a record

    I am very sure that no one else , no other app or person is trying to access the journal that I am creating.

  • Christopher S Profile Picture
    on at
    Re: Logic app issue - Deadlock when writing a record

    Hi @MarkGilbert 

     

    When flow actions run, they might lock the resource they are writing to as if it was a database that locks table/rows/columns. This can be related to more that one user adding records at exactly the same time so you are getting this error message. Unfortunately, Flow doesn't have a setting nor a way to fix this scenario

     

    Best Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow