Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi There,
I have one application which consist of one window service and one wcf service.Window service calls the wcf service after every 15 min. adn then wcf service takes xml file from ftp server and processes this files and inserts the records into SQL serve database. We have used transaction(begin/commit or rollback) for all insert, update and delete operation.
But we are facing some issue like
"Transaction (Process ID 152) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. Source : .Net SqlClient Data Provider Help link : Errors". This case is happening only when we update same xml file data. But we are not able to reproduce this same scenario locally, this is happening only on production. So could you please tell me how to reproduce this same scenario locally or solution for the above issue.
Posted

1 solution

If two processes are trying to use same file you should synchronize this operation. Try to use Mutex for read and write operations, this should help.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900