' uniq_type_name ' (' type ', ' name ') USING BTREE) ENGINE=InnoDBDEFAULT CHARACTER SET=UTF8 COLLATE=utf8_general_ci Row_format=COMPACT; The case of a deadlock is the bulk order of the interface, the external repeated requests two times, two times separated by 10 milliseconds. Two requests executed SQL (one request executes three inserts) except for the primary key ID, the others are the same:Insert intoTe
From: http://blog.163.com/[email protected]/blog/static/128388169200982444858590/?fromdmfromsearch isfromsearchengine=yesProcess Deadlock and workaroundFirst, the point of note(1) Grasp the concept of deadlock and the root cause of the birth and Death lock.(2) Understanding the necessary conditions for the creation of deadlocks-the following four conditions are also available: mutually exclusive conditions,
Original addressProcess Deadlock and workaroundFirst, the point of note(1) Grasp the concept of deadlock and the root cause of the birth and Death lock.(2) Understanding the necessary conditions for the creation of deadlocks-the following four conditions are also available: mutually exclusive conditions, non-preemption conditions, possession and application conditions, cyclic waiting conditions.(3) Remember
As a social-networking App, we have a lot of things going on at the same time, in order to ensure data consistency, we'll use the database.
For example, now we have a point of praise operation, after the success of praise, need to change the heat of the article. The following is an SQL statement:
INSERT into User_praise (uid,plan_id,stage_id) VALUES (123456,14456,10023);
UPDATE plan_hot SET hot = hot + 1 WHERE plan_id = 14456;
Here we need to use
1, turn on trace, write logDBCC TRACEON (3605,1222,-1) –3605 write errorlog,1222 deadlockDBCC TRACEON (1222,-1)/If at startup, add-t 1222At the same time, deadlock graph tracking can be opened in the profile to graphically2, analyze the logs generated under the installation directory1) Determine the deadlock of the resource, according to different viewing methods of different objects.DBCC TRACEON (3604)DBCC
Operating system 2009-09-24 16:48:58 Read 767 comments 1 font size: big Middle Small subscription First, the point of note(1) Grasp the concept of deadlock and the root cause of the birth and Death lock.(2) Understanding the necessary conditions for the creation of deadlocks-the following four conditions are also available: mutually exclusive conditions, non-preemption conditions, possession and application conditions, cyclic waiting conditions.(3)
The main points of this article:
1. The concept of deadlock
2. Why the deadlock is generated.
3. Deadlock conditions.
4. How to resolve the deadlock.
1. Concept of deadlock:
Defined as a "permanent" block between a set of competing system resources or processes that communi
Today is. During the database performance tuning process, I suddenly moved to the previous email with the following information:
From the log, it is found that there is a row-level exclusive lock contention, resulting in a deadlock.
Problem description:* ** 17:03:10. 148 deadlock detected (ORA-00060) [Transaction Deadlock] The following
Two Oracle deadlock solutions for instances
About deadlocks in databases. If you encounter a problem in the application, you will not hesitate to transfer it to the DBA. However, from the current deadlock issue, it is basically the same as the official Oracle description.The following deadlock is not an ORACLE error. It is a
Method One
INSERT into a SELECT * from B with (Xlock) where form_no= @form_no
Method two, stored procedures
sp_who--sql2000 and above
DBCC INPUTBUFFER (SPID)--for viewing specific statements
Kill spid-kills the process.
--Or is
SELECT *
This article uses instances to analyze the solutions for Website access failures caused by database deadlocks.
Problem: the website cannot be accessed. After the host is restarted, the website runs normally.
Solution: Database deadlock.
Cause of deadlock:
Extracting and querying the corresponding data and modifying the Stat table are all operations that modify the same data record for a large amount of da
The database used in the production environment is DB2. But lately there's been a strange deadlock phenomenon: a SELECT SQL statement always has a deadlock.
According to past experience, it is usually the problem of update/delete such as updating SQL statements that will cause deadlocks. And this select
SID of 1, so not getting that said, is blocked and can only wait (Sid 1 commits with itself rollback).Block: Indicates whether the lock is blocking other locks. The number represents a blocking of several--Verify that the identity of the modified table is represented in the TM line (OBJECT_ID). (This is true)Sql> Select object_name from dba_objects where object_id=79729;object_name----------------------------------------------------------------------
not locked.
The following is the deadlock caused by the MySQL for update.
After analysis, MySQL's InnoDB storage Engine practice Lock is a lock line, but it is locked internally, depending on whether the value of the Where condition and select is only primary KEY or Non-key key index to determine how the lock, such as only the primary key, the lock primary key index, if only a Non-key key, then the lock is not primary key index, If the primary key
will lead to deadlocks!
Add an index to the xxx fieldSolve the problem.
Attached exception information:
Caused by: org. springframework. dao. DeadlockLoserDataAccessException: SqlMapClient operation; SQL [];--- The error occurred while applying a parameter map.--- Check the point. updatePointAccount-InlineParameterMap.--- Check the statement (update failed ).--- Cause: com. mysql. jdbc. exceptions. MySQLTransactionRollbackException:
lock), so the difference is here. deadlock so-called deadlock at this point the system is in a deadlock state or the system has a deadlock, and these processes, which are always mutually aulympic, are known as deadlock processes. encounter How
number of updates by index criteria, such as web appsRow-level locks are more suitable for applications that have a large number of concurrent queries, such as some online transaction processing systems, that update data concurrently by index conditions.4. DeadlockRefers to two or more than two processes in the execution process, because of the contention for resources caused by a mutual waiting phenomenon, if there is no external force, they will not be able to proceed.Table-level locks do not
of a deadlock that occurs with 4 threads:Thread 1 for 2 for 3 for 4 for AThread 1 waits for thread 2, thread 2 waits for thread 3, thread 3 waits for thread 4, thread 4 waits for thread 1.Deadlock of the databaseA more complex deadlock scenario occurs in a database transaction. A database transaction may consist of multiple
applications that update data by index conditions, such as Web applications
Row-level locks are more suitable for applications that have a large number of concurrent updates to the index and concurrent queries, such as some online transaction processing systems
4, Dead Lock
Refers to two or more than two processes in the implementation process, as a result of competing for resources caused by a mutual wait for the phenomenon, without external forces, they will not be able to carry forward.
the system generates a deadlock, and these processes, which are always aulympic each other, are known as deadlock processes.Table-level locks do not generate deadlocks. So the solution to the deadlock is mostly true for the most commonly used InnoDB.How deadlocks are handledMysql-uxxx-pxxx-h Server IP--port= server port, (if the server has IP and port access, be
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.