Azure data factoty - stored procedure executed by a lookup activity ran successfully but failed to commit to DB on 13 Jan 2025

Bill Chie 0 Reputation points
2025-01-16T18:14:38.6433333+00:00

Hi,

I have several Azure Data Factory pipelines that run stored procedures using lookup activities. On January 13, 2025, these activities executed successfully without any errors, but the records were not committed to the database. The same activities could be rerun successfully without any changes after 9 AM on January 14, 2025.

I checked across different clients (i.e., different ADFs and DBs) and found the same symptoms. When the lookup activity isolation level is blank, there are no issues. However, the problem occurs when the isolation level is set to "read committed."

Would like to know what can be the possibly cause and how to prevent this from happening again?

Regards

Bill

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,209 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Chandra Boorla 7,960 Reputation points Microsoft Vendor
    2025-01-16T19:32:50.49+00:00

    @Bill Chie

    Greetings & Welcome to Microsoft Q&A forum! Thanks for posting your query!

    As I understand that the issue you encountered with the Azure Data Factory lookup activity may be related to the isolation level set to "read committed." When using this isolation level, transactions may not see uncommitted changes made by other transactions, which could lead to situations where the stored procedure appears to execute successfully but does not commit the changes to the database due to locks or other transaction-related issues.

    To prevent this from happening in the future, consider the following approaches:

    Use Stored Procedure Activity - The most recommended approach is to migrate from using Lookup activities to the dedicated Stored Procedure activity in ADF. This activity is designed specifically for executing stored procedures and provides better control over transaction management and error handling.

    Error Handling - Implement robust error handling and logging in your ADF pipelines to capture any anomalies during execution. This can help identify if there are specific conditions leading to the failure to commit.

    Implement Retry Logic - Add retry logic in your ADF pipelines. If a stored procedure fails to commit due to blocking, you can retry the execution after a short delay. This can help mitigate transient issues.

    Use Snapshot Isolation - If your database supports it, consider using snapshot isolation. This allows transactions to read a consistent snapshot of the data without being blocked by other transactions, reducing the likelihood of blocking issues.

    Database Monitoring - Monitor your database for locks and long-running transactions that might interfere with the execution of your stored procedures. Tools like SQL Server Profiler or Azure SQL Analytics can provide insights into transaction behavior.

    For further details, please consult the following Microsoft documentation, which may provide valuable insights:

    If the issue persists after switching to the Stored Procedure activity and implementing monitoring, please provide the database logs from the affected time period. We will assist you further.

    I hope this information helps. Please do let us know if you have any further queries.

    Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.