摘要: using (var uow = UnitOfWorkManager.Begin(TransactionScopeOption.RequiresNew)) { //所有数据库的操作 uow.Complete(); } 阅读全文
posted @ 2020-03-13 14:18 紫心落 阅读(238) 评论(0) 推荐(0) 编辑
摘要: //分批处理 int skip = 0; int takeSize = 1000; int totalCount = List.Count(); List<Task> taskList = new List<Task>(); while (skip < totalCount ) { var batc 阅读全文
posted @ 2020-03-13 14:17 紫心落 阅读(389) 评论(0) 推荐(0) 编辑
摘要: 针对当前用户进行加锁 private readonly static Dictionary<long, object> dic = new Dictionary<long, object>(); 方法内部加入 object syncLocker = new object(); dic.TryGetV 阅读全文
posted @ 2020-03-13 14:16 紫心落 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 在接口方法上加上即可[DontWrapResult] 阅读全文
posted @ 2020-03-13 14:15 紫心落 阅读(120) 评论(0) 推荐(0) 编辑
摘要: --查看被锁表:--spid 锁表进程 --tableName 被锁表名 select request_session_id spid,OBJECT_NAME(resource_associated_entity_id) tableName from sys.dm_tran_locks where 阅读全文
posted @ 2020-03-13 14:11 紫心落 阅读(529) 评论(0) 推荐(0) 编辑