问题描述
您好,
我有一个应用程序,包含一个窗口服务和一个wcf服务.Window服务每15分钟调用一次wcf服务。然后,wcf服务从ftp服务器获取xml文件并处理此文件并将记录插入SQL服务数据库。我们使用事务(开始/提交或回滚)进行所有插入,更新和删除操作。
但我们正面临一些问题,例如
事务(进程ID 152)在锁资源上与另一个进程陷入僵局,并被选为死锁牺牲品。重新运行事务。来源:.Net SqlClient数据提供程序帮助链接:错误。仅当我们更新相同的xml文件数据时才会发生这种情况。但我们无法在本地重现同样的情况,这只发生在生产上。那么请你告诉我如何在本地重现这个相同的场景或解决上述问题。
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.
推荐答案
这篇关于如何使用窗口服务和wcf服务来避免死锁whicle处理xml文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!