锁定SQL [英] Locking in sql

查看:102
本文介绍了锁定SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想知道在网站上工作时,当我们有多个用户在表上工作时,这是处理dml语句在sql中锁定的最佳方法.

Hi all,
I want to know while working on websites, which is the best way of handling locking in sql for dml statements when we have multiple users working on the tables.

推荐答案

最好的是满足您业务需求的任何东西.您可能只需要处理事务中的复杂操作,但是也许您需要添加一列以将记录标记为其他人正在使用,并编写阻止其他用户访问该记录的代码. CP会这样做,如果我要编辑您的帖子,那么在完成之前,其他任何人都无法访问它.
What''s best is whatever meets your business needs. Handling complex operations in transactions may be all you need, but perhaps you need to add a column that marks a record as in use by someone else, and to write code that stops other users accessing it. CP does this, if I were to edit your post, no-one else could access it until I am done.


这篇关于锁定SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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