摘要: Here’s an example of the classic scenario that is usually used to introduce the concept of a deadlock in a database: ... 阅读全文
posted @ 2009-03-16 17:03 自助者天助 阅读(380) 评论(0) 推荐(0) 编辑
摘要: In this post I’ll look at an actual deadlock, then troubleshoot it using the steps I described in Deadlock Troubleshooting, Part 1 so you can see them in action. This is a simplified version of a de... 阅读全文
posted @ 2009-03-16 17:02 自助者天助 阅读(314) 评论(0) 推荐(0) 编辑
摘要: A deadlock is a circular blocking chain, where two or more threads are each blocked by the other so that no one can proceed. When the deadlock monitor thread in SQL Server detects a circular blocking ... 阅读全文
posted @ 2009-03-16 17:01 自助者天助 阅读(676) 评论(0) 推荐(0) 编辑
摘要: 1. 死锁原理 根据操作系统中的定义:死锁是指在一组进程中的各个进程均占有不会释放的资源,但因互相申请被其他进程所站用不会释放的资源而处于的一种永久等待状态。 死锁的四个必要条件: 互斥条件(Mutual exclusion):资源不能被共享,只能由一个进程使用。 请求与保持条件(Hold and wait):已经得到资源的进程可以再次申请新的资源。 非剥夺条件(No pre-em... 阅读全文
posted @ 2009-03-16 17:00 自助者天助 阅读(637) 评论(0) 推荐(0) 编辑
摘要: 一. 为什么要引入锁 多个用户同时对数据库的并发操作时会带来以下数据不一致的问题: 丢失更新 A,B两个用户读同一数据并进行修改,其中一个用户的修改结果破坏了另一个修改的结果,比如订票系统 脏读 A用户修改了数据,随后B用户又读出该数据,但A用户因为某些原因取消了对数据的修改,数据恢复原值,此时B得到的数据就与数据库内的数据产生了不一致 不可重复读 A用户读取数... 阅读全文
posted @ 2009-03-16 16:58 自助者天助 阅读(269) 评论(0) 推荐(0) 编辑