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. @Autowired获取配置文件中被注入实例的两种方式

    一.说明 二.那么在JavaBean中如何通过@Autowired获取该实例呢?有两种方式: 1.直接获取 @RunWith(SpringJUnit4ClassRunner.class) @Conte ...

  2. FlushMode属性与transaction(spring注入的事务)

    一.参见hibernate的api http://tool.oschina.net/apidocs/apidoc?api=hibernate-3.6.10 http://tool.oschina.ne ...

  3. 谈谈怎么实现Oracle数据库分区表

    谈谈怎么实现Oracle数据库分区表 数据库的读写分离 SQLSERVER性能监控级别步骤 Oracle索引问题诊断与优化(1)

  4. How to Cope with Deadlocks

    http://dev.mysql.com/doc/refman/5.0/en/innodb-deadlocks.html How to Cope with Deadlocks This section ...

  5. Stretch a row if data overflows in jasper reports

    My band stretches if necessary with the following conditions, I do not know yours. I have started wi ...

  6. ECSHOP报错误Deprecated: preg_replace(): The /e modifier is depr

    http://www.ecshoptemplate.com/article-1850.html

  7. DJANGO结合jQuery cxSelect 作二级菜单过滤

    EN,到这个阶段,基本功能算是完成了. 使用了jQuery cxSelect这个插件. http://code.ciaoca.com/jquery/cxselect/ 相关代码如下: html: &l ...

  8. linux ln命令 创建链接(快捷方式)

    命令格式: ln -s 目标地址 链接名称 # 假设/home目录下有wuyou文件夹,你要在当前目录创建一个链接指向它 $ ln -s /home/wuyou wuyou_link

  9. 【NOIP 2016 总结】

    距离杯赛已经很久了,然而我现在才打总结.. 我好惨的说..两场才380... DAY 1 第一题 toy 送分题,模拟的时候+一下再mod一下就好. [当时打完这题就没再看一眼了,好方的说] #inc ...

  10. Let's go! (Ubuntu下搭建Go语言环境)

    自2009年Go语言发布以来,我一直在关注Go语言,如今Go语言已经发展到1.2版本,而且也收到越来越多的人关注这门语言.Go语言设计的目的就是为了解决执行数度快但是编译数度并不理想(如C++)以及编 ...