Tag:deadlock

  • Deadlocking of SQL Application in SQL 2008

    Time:2019-9-22

    Neither session 1 nor session 2 can continue until the other party releases resources. So, SQL Server chooses a session in a deadlock as a “deadlock victim”. Note: The session of the deadlock victim is killed and the transaction is rolled back. Be careful:deadlockAnd normalblockThey are two often confused concepts. Some reasons for deadlock: 1. […]

  • The Method of Deadlock Analysis on Linux Platform

    Time:2019-9-12

    Deadlocks: refers to the phenomenon that two or more processes (threads) are waiting for each other because of competing for resources in the execution process. Without external force, they will not be able to advance. At this time, it is said that the system is in a deadlock state or that the system has a […]

  • Beginners Understand MySQL Deadlock Problem from Source Code

    Time:2019-9-2

    Through many difficult single-step debugging late at night, an ideal breakpoint has been found, and most of the lock acquisition process can be seen.The code is inlock0lock.cOfstatic enum db_err lock_rec_lock() In the function, this function shows the process of acquiring the lock and whether the lock was successful or not. Scenario 1: Delete by primary […]

  • Understanding MySQL deadlock routine through unique index S locks and X locks

    Time:2019-9-1

    In the beginner’s understanding of MySQL deadlock from source code, the process of using debugging MySQL source code to view deadlock is introduced. This article describes a common case.This time we’re going to talk about love and hatred between S lock and X lock, the only index. Let’s look at a simplified example. # Constructing […]

  • Solving MySQL deadlock routine by different index updates

    Time:2019-8-31

    Previous articles have introduced the use of source code to debug lock-related information. Here we also use this tool to solve an online real deadlock case. It is also the first two cases of deadlock caused by SQL that we introduced. Because of the complexity of the online table structure, some simplifications are made as […]

  • Deadlock Solution for Oracle Data Table

    Time:2019-8-21

    A Simple Method of Investigation and Solution Deadlock Error Reporting: ORA-00060: deadlock detection while waiting for resources Corresponding Chinese error is: ORA-00060: deadlock detected while waiting for resources Execute the following SQL to view the locked table: select object_name, machine, s.sid, s.serial# from v$locked_object l, dba_objects o, v$session s where l.object_id = o.object_id and l.session_id […]

  • Analysis and Solution of Sql Server Deadlock Monitoring

    Time:2019-8-20

    1 Background 1.1 Alarm Recently, I’ve been sorting out my notes and intending to migrate them all to EVERNOTE. Tidy up to the lock part, there happens to be a case recorded by myself, reorganize and share it to you. One day at noon, received an alarm message, DB deadlock abnormal, one minute deadlock 120. […]

  • Batch insertion order is inconsistent under the unique index of MySQL deadlock routine

    Time:2019-8-4

    Preface The essence of deadlock is resource competition. Batch insertion can easily lead to deadlock if the order is inconsistent. Let’s analyze this situation. To facilitate demonstration, batch inserts are rewritten to multiple inserts. First, do a few small experiments. The simplified table structure is as follows. CREATE TABLE `t1` ( `id` int(11) NOT NULL […]

  • SQL Server Learning Note Transaction, Locking, Blocking, Deadlock Usage

    Time:2019-6-27

    This paper illustrates the transaction, locking, blocking and deadlock usage of learning notes by SQL Server. Share for your reference, as follows: 1. Affairs Implicit transaction /*================================================================== When created, dropped, fetch,open, revoke,grand, alter table,select,insert,delete,update,truncate table When the statement is first executed, the SQL Server session automatically opens a new transaction. If the implicit transaction mode […]

  • SQL2005 View Deadlock stored procedure sp_who_lock

    Time:2019-5-3

    The following is my monitoring SQL Server database, whether there are deadlocks and blockages in the performance testing process of the SQL statements, still relatively prepared, left for standby. Call method: Select the corresponding database and exec sp_who_lock USE [master] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE procedure [dbo].[sp_who_lock] as begin declare […]

  • Sharing the whole process of deadlock checking in SQL Server

    Time:2019-4-7

    Preface I remember that in the past, customers occasionally encountered deadlock problems when using software, because the time of occurrence is uncertain, and it is difficult to reproduce the problem. At that time, it was a bit difficult to solve the problem. Four necessary conditions for deadlock: Mutual exclusion: Resources cannot be shared and can […]

  • Design of a Game Accounting System’s Database Settlement

    Time:2019-3-4

    Suppose there is a simple guessing game, in which the user bets big or small, after deducting 3% of the fee, all the money is put into the pool, and the winner divides the pool equally according to the proportion of the betting. Using MySQL as the database, the accuracy of the system is up […]