English 中文(简体)
截止日期——这是否真正有助于?
原标题:Deadlocks - Will this really help?

因此,我要提出一个问题,使我陷于僵局。 了解该制度的人可以清楚地说明为什么这种争执正在陷入僵局,但他们告诉我,我应该补充这一点:

SET NOCOUNT ON
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

这是否真正是有效的解决办法? 做些什么?

最佳回答
问题回答

que 不大可能帮助Imzh

SET NOCOUNT ON

这个问题不会有任何影响。

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

您的问询将妨碍大家共同走锁。 除了阅读“继承”数据外,还可能导致你对同一行的两读,或者完全取决于其他同时进行的活动。

能否解决你的僵局取决于僵局的类型。 如果问题有2名作者由于不按规定提出24小时要求而陷入僵局,那么它就没有任何效果。 (交易1更新浏览量,交易2更新浏览量b,然后是第1部分,要求锁在B和2栏,要求锁在(a)上)

您能否把犯罪论调和僵局成图? (如果你在2005年或之后坐在Q8)

在不同的方面,可以考虑另外两个方面,这可能有助于。

(1) 指数和国库所用的指数。 表格中使用的指数化战略将影响到多少行。 如果你采用独特的指数修改数据,你可以减少僵局的可能性。

一种算法——当然不会对所有案件都适用。 使用无杀伤人员地雷的具体目标不是全球性的。

The "old" way:
UPDATE dbo.change_table
   SET somecol = newval
 WHERE non_unique_value =  something 

The "new" way:
INSERT INTO #temp_table
    SELECT uid FROM dbo.change_table WITH (NOLOCK)
     WHERE non_unique_value =  something 

UPDATE dbo.change_table
   SET somecol = newval
  FROM dbo.change_table c
       INNER JOIN
       #temp_table t
       ON (c.uid = t.uid)

2) Transaction duration The longer a transaction is open the more likely there may be contention. If there is a way to reduce the amount of time that records remain locked, you can reduce the chances of a deadlock occurring. For example, perform as many SELECT statements (e.g. lookups) at the start of the code instead of performing an INSERT or UPDATE, then a lookup, then an INSERT, and then another lookup. This is where one can use the NOLOCK hint for SELECTs on "static" tables that are not changing reducing the lock "footprint" of the code.





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

难以执行 REGEXP_SUBSTR

I m 查询Oracle 10g。 我有两张表格(样本数据见下文)。 i m 试图提取一些领域

SQL Query Shortcuts

What are some cool SQL shorthands that you know of? For example, something I learned today is you can specify to group by an index: SELECT col1, col2 FROM table GROUP BY 2 This will group by col2

PHP array callback functions for cleaning output

I have an array of output from a database. I am wondering what the cleanest way to filter the values is example array Array ( [0] => Array ( [title] => title 1 ...

OracleParameter and DBNull.Value

we have a table in an Oracle Database which contains a column with the type Char(3 Byte). Now we use a parameterized sql to select some rows with a DBNull.Value and it doesn t work: OracleCommand ...

Running numbers in SQL

I have a SQL-statement like this: SELECT name FROM users WHERE deleted = 0; How can i create a result set with a running number in the first row? So the result would look like this: 1 Name_1 2 ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...