locked
Deadlock error 1205. Kindly help RRS feed

  • Question

  • Hi,

    I got deadlock error when trying to insert a new record when parallel process of import is running side by side. When i try to insert two table hit Table A and Table B. Table B take id of table A as foreign key. In import process table A is used. When i insert new record it miss the table A and trying to insert in table B but Table A id is not present and foreign key constraint error occur due to which i got dead lock error.

    Kindly help me to understand that is it possible my import process Lock the table A and not allow to insert new record in this table.

    Thanks! 

    • Changed type Olaf HelperMVP Wednesday, November 9, 2016 9:46 AM More a question then a discussion
    Wednesday, November 9, 2016 9:30 AM

Answers

  • Hi nitraw26,

    I cannot comment much without seeing sample table/sample statement but if I understand this correctly, you are facing a deadlock which caused by foreign key validation. For more information, please review this article.

    If you have any other questions, please let me know.

    Regards,
    Lin

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 10, 2016 7:28 AM
  • Hi nitraw,

    In such situations deadlocks can occur, especially when using bad database design and processing logic; see

    Blocking Locks and Deadlocks
    Deadlocking and follow up links


    Please Dont forget to mark as answer and Helpful Post. It helps others to find relevant posts to the same question. Milan Das

    Friday, November 11, 2016 6:35 AM

All replies

  • Hi nitraw26,

    I cannot comment much without seeing sample table/sample statement but if I understand this correctly, you are facing a deadlock which caused by foreign key validation. For more information, please review this article.

    If you have any other questions, please let me know.

    Regards,
    Lin

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 10, 2016 7:28 AM
  • Hi nitraw,

    In such situations deadlocks can occur, especially when using bad database design and processing logic; see

    Blocking Locks and Deadlocks
    Deadlocking and follow up links


    Please Dont forget to mark as answer and Helpful Post. It helps others to find relevant posts to the same question. Milan Das

    Friday, November 11, 2016 6:35 AM