Like ever, today’s article of Pinal Dave was interesting and informative. After, our mutual discussion between our DBAs and Developers on Pinal Dave topic of Concurrency and Isolation. I felt that most of us are intermingling three equally sounding words. Those are LOCKING, BLOCKING and DEAD LOCKING.
Lets try to revisit these concepts with some simple analogies.
LOCKING occurs when connection needs access to a piece of data in database and it’s necessary for SQL Server when managing multiple connections. Just assume an example of your garage, when you park your car in garage, basically you are locking the place of garage.
 
BLOCKING occurs when two connections need access to same piece of data concurrently and one connection is blocked because at a particular time, only one connection can have access. Just like, you stop (block) your car on a traffic signal because some other car or cars are using the crossing area.
 
DEAD LOCK occurs when one connection is blocked and waiting for a second to complete his work, but on other side, second connection is also waiting for first connection to release the lock. Just like, you need to cross the signal area but same time someone else from opposite side also want to cross the signal. Now, you need a way which other is holding and other need way where your car is.
 
That is why, one should be clear that locking is integral part of SQL Server to handle concurrency, blocking is bad when one connection/transaction is waiting unnecessary for a long time, and deadlocking is a phenomenon which should never occur.

SQL Server: Difference Between Locking, Blocking and Dead Locking的更多相关文章

  1. SQL Server查看被锁的表 - dead lock

    select str(request_session_id ,4 ,0) as SPID ,convert(varchar(20) ,db_name(resource_database_id)) as ...

  2. SQL Server: Difference between PARTITION BY and GROUP BY

    https://stackoverflow.com/questions/2404565/sql-server-difference-between-partition-by-and-group-by ...

  3. Introduction to Locking in SQL Server

    Locking is a major part of every RDBMS and is important to know about. It is a database functionalit ...

  4. 在SQL Server里为什么我们需要更新锁

    今天我想讲解一个特别的问题,在我每次讲解SQL Server里的锁和阻塞(Locking & Blocking)都会碰到的问题:在SQL Server里,为什么我们需要更新锁?在我们讲解具体需 ...

  5. SQL SERVER 2008配置Database Mail –用SQL 数据库发邮件

    SQL SERVER 2008配置Database Mail –用SQL  数据库发邮件 https://blogs.msdn.microsoft.com/apgcdsd/2011/06/28/sql ...

  6. SQL Server Dead Lock Log

    1 . 模拟Dead Lock Session1: begintran insertintoT1(name)values('test1') UpdateT2setname='test1' commit ...

  7. 如何有效抓取SQL Server的BLOCKING信息

    原文:如何有效抓取SQL Server的BLOCKING信息 转自:微软亚太区数据库技术支持组 官方博客 http://blogs.msdn.com/b/apgcdsd/archive/2011/12 ...

  8. The difference between Union & Union All in SQL Server/pOSTGRESQL

    Following is test in SQL Server: USE [TestDB] CREATE TABLE [dbo].[UserInfoTest02]( [number] [bigint] ...

  9. Microsoft SQL Server Trace Flags

    Complete list of Microsoft SQL Server trace flags (585 trace flags) REMEMBER: Be extremely careful w ...

随机推荐

  1. JSP页面用EL表达式 输出date格式

    JSP页面用EL表达式 输出date格式 1.头上引入标签 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix ...

  2. CSS3新的字体尺寸单位rem

    CSS3引入新的字体尺寸单位 rem ,可以简单记忆为root rm. CSS3的出现,他同时引进了一些新的单位,包括我们今天所说的rem.在W3C官网上 是这样描述rem的——“font size ...

  3. Linux中的MyEclipse配置Hadoop

    一.所需软件 注意:安装MyEclipse后,我再已安装软件里找不到MyEclipse,所以我在root权限下用命令行启动MyEclipse,貌似避免了很多权限问题. sudo su 输入密码 cd ...

  4. 无法为请求的 Configuration 对象创建配置文件 错误原因

    Configuration config = WebConfigurationManager.OpenWebConfiguration("~"); 无法为请求的 Configura ...

  5. MVC 自定义AuthorizeAttribute 实现权限验证

    MVC内置的AuthorizeFilter先于Action/Result过滤器执行,为网站权限验证提供了很好的一套验证机制. 通过自定义的AuthorizeAttribute可以实现对用户权限的验证. ...

  6. ppshu

    全部书籍已经下载完毕! http://3cvpkfx4gdnkcduj.onion/ https://3cvpkfx4gdnkcduj.onion.cab/ https://3cvpkfx4gdnkc ...

  7. 云风的BLOG❳可靠 UDP 传输

    http://mp.weixin.qq.com/s?__biz=MzA3NjYxOTA0MQ==&mid=405432715&idx=1&sn=2e40ceafd4b298e1 ...

  8. HDU1180+BFS

    bfs思路:三维标记状态 && 处理好 - | 和时刻的关系即可 /* bfs 思路:三维标记状态 && 处理好 - | 和时刻的关系即可 */ #include< ...

  9. Android ExpandableListView 带有Checkbox的简单应用

    expandablelistview2_groups.xml <?xml version="1.0" encoding="utf-8"?> < ...

  10. HDU4908——BestCoder Sequence(BestCoder Round #3)

    BestCoder Sequence Problem DescriptionMr Potato is a coder.Mr Potato is the BestCoder.One night, an ...