即使没有显式事务,SQL Server也会获取锁吗? [英] Does SQL Server acquire locks even without an explicit transaction?

查看:102
本文介绍了即使没有显式事务,SQL Server也会获取锁吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是第一次阅读有关MSSQL锁定的文章,在很多地方,锁定机制的概念取决于Transactions的存在.我想知道在不涉及任何事务的情况下是否可以锁定(通常)?

I was reading about MSSQL Locking for the first time, and it many places, the locking mechanism concepts depend on the existence of Transactions. I was wondering whether locking (in general) is possible without having any Transactions involved?

推荐答案

不存在显式事务时,将在自动(自动提交)事务中执行每个SQL语句.在这种情况下,将应用正常的锁定行为,并且当语句完成时,自动事务完成时,将释放锁定.

When no explicit transaction exists, each SQL statement is executed in an automatic (autocommit) transaction. Normal locking behavior will apply in that case and the locks released when the automatic transaction is completed as the statement completes.

这篇关于即使没有显式事务,SQL Server也会获取锁吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆