Problem while importing the data into sql server 2005 .
-
Hi, My front end is VB.net 2008. Database - sql server 2005 I have two import processes. In both process there are two tables where insertion updation takes place. After running both the process simultaneously, I am facing the following crash Transaction (Process ID 81) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction This is the exception, which is coming in between the simultaneous import process. I then used an alternative to resolve this problem. When ever this exception comes, I resend te control(at front end) from catch block to the beginning of the function, this is letting the second process to complete and as I mentioned the control again starts to execute the process from the scratch , it do the work nicely now for first process also. Now both the imports are working fine. For both the processes, I am using the Begin , Commit , Rollback Transaction. Is it enough? Please let me know if you face any problem in understanding the question.
-
Hi, My front end is VB.net 2008. Database - sql server 2005 I have two import processes. In both process there are two tables where insertion updation takes place. After running both the process simultaneously, I am facing the following crash Transaction (Process ID 81) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction This is the exception, which is coming in between the simultaneous import process. I then used an alternative to resolve this problem. When ever this exception comes, I resend te control(at front end) from catch block to the beginning of the function, this is letting the second process to complete and as I mentioned the control again starts to execute the process from the scratch , it do the work nicely now for first process also. Now both the imports are working fine. For both the processes, I am using the Begin , Commit , Rollback Transaction. Is it enough? Please let me know if you face any problem in understanding the question.
Even we had deadlock proplem in one of our SQl Job. We did following. Used Begin Try End Try block & Begin catch End catch block. Use a flag in the permanent table which indicated processed or not. When trying to rerun run only those which is not processed. This way second time when you run it processes only which are not processed.