A situation caused by two or more processes being unable to proceed (and thus release their locks) because they are blocked by locks on resources held by the other process.

learn more… | top users | synonyms

3
votes
1answer
254 views

Deadlock free MERGE-alike in MySQL?

I am trying to implement some parts of MERGE in the MySQL driver in Drupal. Of course, Drupal has something but in truth it only works because the most frequent MERGE issuer just eats exceptions. So, ...
0
votes
0answers
43 views

Avoid transaction rollback when Deadlock is encountered (mysql)

I'm currently trying to handle concurrent inserts correctly using MySQL, I'm basically doing the following: CREATE TABLE foo (id INT NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE bar (id INT NOT ...
1
vote
0answers
13 views

Amazon rds MySql -> concurrent connections deadlocks

I normally hang around in StackOverflow but I think this issue is better suited here. I've built an application in C#.NET that uses MySql as a database. My application inserts and updates data in the ...
1
vote
0answers
45 views

Multi-victim deadlock in SQL Server

I have been seeing a lot of deadlocks occurring on a system with deadlock graphs similar to this one: I have been advised that it is a multi-victim deadlock but I cannot re-create a deadlock graph ...
1
vote
0answers
23 views

What do spikes in InnoDB lock structures indicate?

I co-maintain a high traffic site similar to StackExchange. It runs MySQL 5.1 (working on replacing it with MySQL 5.5 or MariaDB). All our tables are InnoDB. MySQL goes down a couple of times a day. ...
1
vote
2answers
52 views

Changing two publications at the same time causes deadlock in distribution database

I have transactional replication setup. Let's say three databases on server A replicate to corresponding three databases on Server B. The databases are identical (same structure for different ...
0
votes
1answer
41 views

MySQL: Transaction and Deadlock

I have table "tbl_data", where have a lot of rows (3 - 5 million). I have JAVA (*.jar) module from which I INSERT/UPDATE data into this table. If I start *.jar file (for example, "run.jar") and after ...
6
votes
0answers
178 views

Is this a race condition or bug in sql server using serializable TIL with updlock? [closed]

I've been staring at this problem for almost a week now. I'm getting a deadlock in some query, and I've reduced the problem to these reproducible steps: Create a database with: create table offering ...
1
vote
1answer
76 views

Deadlock occurring on database, SQL Server 2008R2

Last few days I had major problems with my production site, turns out deadlock occurred, every half an hour maybe 50-60 of them. To do a quick fix in order to keep the site running I set : ...
1
vote
0answers
49 views

Side effects of using updlock lock hint?

I was just exploring UPDLOCK hint in SQL-Server 2008 and I found it is very useful in avoiding certain deadlock scenarios. There are always some side effects when using these types of lock hints but I ...
5
votes
2answers
149 views

SQL Server 2000 - 'Performance: Deadlock'

We had to restart our SQL Server today, we had made no changes to it. When it came back up we immediately started getting this error from the server DATE/TIME: 2/27/2014 3:09:31 PM ...
4
votes
1answer
53 views

How can a connection for one DB block a connection to another DB in SQL Server?

We have an interesting scenario. For weeks, we have been experiencing 'outages' on SQL Server 2008 -- where our websites have slowed to a crawl and mass timeouts for all customers who have DB's ...
2
votes
1answer
78 views

Avoiding Deadlocks

We currently have a trigger-based system in place that does the following: When records in certain tables are modified, a trigger fires that makes a field NULL in a varying number of records in ...
0
votes
1answer
71 views

SQL Server 2008R2 - Stored Procedure with 2 updates causing deadlocks

I have a web api web service that calls an authentication stored procedure. This stored procedure calls a different stored procedure that does 1 update: UPDATE ...
14
votes
3answers
5k views

Code to simulate deadlock

I am testing my application I need some code that stable simulates the deadlock on database site (sql script if possible). Thank you. ADDED: Reproducing deadlocks involving only one table
2
votes
1answer
891 views

How I prevent deadlock occurrence in my application?

I am developing an LMS application in PHP framework(Codeigniter 2.1.0). I am using MySQL database. All the tables in the database have innodb engine. I also created indexes on each tables. Now I am ...
0
votes
0answers
21 views

Why are there more MySQL deadlocks on my 8-core machine than 16-core?

I'm running a bunch of scripts in parallel that do: START TRANSACTION REPLACE INTO... REPLACE INTO... REPLACE INTO... ... COMMIT On my 8-core machine, where 8 of these processes are running in ...
2
votes
2answers
100 views

Reducing deadlocks with update query hint or other method

I'm getting 20-30 deadlocks per day on the same table. (2 mil rows) Profiler DeadlockGraphs show KEY LOCK and PAGE LOCK (See attched jpg) Total datatype size per row = 114 bytes We have multiple ...
2
votes
1answer
85 views

How to use proper hints for Upsert involving a top 1 subquery

For this specific case (tracking Load Balancer switches) we wish to optimize an Upsert so that it does not exhibit any race conditions, cause any PK violation, or acquire any over sized locks. ...
0
votes
0answers
63 views

Mysql Deadlock explanation

I have a problem with reading innodb monitor output. It's seem that problem in gap lock on FK_SESSION_CLIENT_ID index. But i can't simulate this situation on dev host. Transaction isolation level is ...
0
votes
0answers
25 views

Indexing and Deadlock in SQL Server 2008? [duplicate]

I am running into a deadlock in SQL Server 2008. Using profiler I was able to determine that the deadlock happens as I am trying to select and update row(s) in table in 2 different sessions. The ...
3
votes
1answer
545 views

PAGELOCK Conversion Deadlock From Update to Intent Exclusive

A customer of ours is experiencing frequent deadlocks. The deadlocks are mostly on the same UPDATE statement. The deadlocks follow a pattern in which both SPIDs have acquired an update (U) lock on a ...
1
vote
3answers
112 views

Keeping an eye on contention

In SQL Server, I am using the following command to see blocked sessions: select * from sys.sysprocesses where blocked>0 This is super. The problem is I need to see what block sessions there ...
4
votes
1answer
127 views

Stored procedure deadlocking itself

I have a strange situation, seen from the log: Process 37278 waits for ExclusiveLock on advisory lock [16421,999999,12864385,2]; blocked by process 53807. Process 53807 waits for ExclusiveLock on ...
1
vote
1answer
252 views

How does locking work in INSERT..ON DUPLICATE KEY UPDATE statements?

I am encountering deadlocks while trying to update multiple rows (a batch) using INSERT..ON DUPLICATE KEY UPDATE. Does MySQL lock all the rows in one batch or does it lock only the row it is updating ...
0
votes
0answers
139 views

Single DELETE statement deadlocking in Sybase ASE

I've got a fairly straightforward process running on ASE 15.7, that creates rows in two tables and later deletes them. The tables are both configured to use datapages for the locking scheme, and the ...
4
votes
1answer
286 views

After 5 years of working, SQL Server 2k5 Table now locking without any changes made to DB

I have a table: OrderDetails. For 5 years, only the odd Deadlock has occured. If it happened, it happened on indexes which was on OrderDetails table Now all of a sudden, deadlocks are everywhere - ...
0
votes
0answers
47 views

Lock timeouts on a table with two keys, where only one connection writes for a given value of the first key at a time

I have a table user_rollup_message_list that is keyed by (user_id, message_reference). It is a write-heavy table, and gets enough writes that I get many lock timeouts, with a timeout of 50 seconds, ...
3
votes
2answers
246 views

Can 2 tables lock each other if concurrent read/update do not affect same rows? pagelocks off

Can 2 tables cause a deadlock, if the pagelocks are off, and the rows are not related. E.g. Query 1 runs for a few seconds Select * from Orders where CustomerID = 1 and DateOrdered between @D1 and ...
0
votes
0answers
40 views

MySQL on DRDB very fragile

My website (a Magento store) runs perfectly fine most of the time, until at some point MySQLd gets hammered with a few more INSERTs than normal, and then locks up. I run MySQL on Linodes with Debian ...
2
votes
0answers
120 views

Read-Commited Snaphsot isolation causing deadlocks?

Our DBA has some type of process setup to monitor deadlocks and sends out an emails when a deadlocks occurs. We have been testing read committed snapshot isolation on our application for a couple ...
1
vote
1answer
698 views

MySQL: Alter Table on very active table gives “Waiting for table metadata lock”

At my work, we've recently upgraded to MySQL 5.5 and since then, have been bitten a few times by the new (and intended) behavior of metadata locking. Basically, whenever we run an ALTER TABLE ...
0
votes
1answer
581 views

Why are these two INSERTs deadlocking? Is it the trigger? What does this deadlock trace 1222 log tell me?

We are seeing intermittent deadlocks in production when receiving multiple simultaneous API requests. Each request basically culminates in an INSERT statement into the same table, which is where we ...
0
votes
0answers
33 views

Locking the table so that no transactions can complete

I am using following procedure to do some duplicate checking before inserting into master table from staging table and if there any duplicate records, these records should be moved to duplicate ...
0
votes
1answer
177 views

Deadlock from mysqldump --single-transaction, is it possible?

Is it possible to get a deadlock if you ran mysqldump with the argument --single-transaction ? or any other complication ? If it is used to backup a live site with many other querys running at the ...
2
votes
1answer
419 views

DB2 Communication link failure issue

I would like to get your valuable suggestions for the below problem. My Perl application connects to a DB2 database and keeps inserting data into a table. The application successfully inserts data ...
2
votes
1answer
582 views

SSIS package blocks itself if uses TRUNCATE

There is an SSIS package with Required transaction on the package level and Supported on the tasks level. The main part of the package is deleting the data and inserting new data: Here the Delete ...
1
vote
1answer
150 views

DB2 Insert and Deadlocks

My application has 4 different threads doing inserts into the same DB2 table simultaneously. Could this cause a deadlock / lockwait situtation? Theoretically I don't see a problem here; as one ...
1
vote
0answers
348 views

SELECT + INSERT + Query Cache = MySQL lock up

MySQL server seems to constantly lock up and stop responding on certain types of queries and eventually (after couple of minutes of not responding) give up with an error "MySQL server has gone away", ...
1
vote
1answer
59 views

Increased server load after InnoDB deadlock

I am using InnoDB instead of MyISAM for a couple of months right now, and it has really optimized my game database-wise. I was aware of the danger of deadlocks, but hadn't had any problems with it, ...
-1
votes
0answers
105 views

Postgres database locked up [closed]

I was running a process to update a bunch of rows in postgres database and it locked up. Now I can't select anything out of it. None of my processes are "idle in transaction" when I execute ps ...
-1
votes
1answer
312 views

dead lock when updating [closed]

Update Operation.TrTable Set RecordId = RecordTABLE.newRecordId From Operation.TrTable tr Inner Join ( SELECT r.Id AS newRecordId, r.KeyM AS MappingKey From ...
2
votes
0answers
791 views

Oracle Select Query Over Database Link Suddenly Hangs Endlessly

I have a query that's been in use for years and today it started hanging endlessly. I took the query apart and found the piece causing it to hang is a simple join on a primary key that should run like ...
3
votes
1answer
583 views

Understanding SIX lock in Microsoft SQL-Server

Can somebody explain me how a process can acquire SIX lock on a page? I my deadlock-graph xml file I see that a process running under RC isolation level (executing a select statement at the moment of ...
5
votes
2answers
152 views

Given two known statements, how can I replicate deadlock?

I have two statements (an update against every row in one table (call it table A) and a delete on another table that looks up rows in table A) that I know are causing occasional deadlocks. It seems ...
4
votes
2answers
897 views

Oracle 11g see transaction or session start time

I want to know when a session or transaction started. The deadlock file doesn't give me this information. Is there some logfile that keeps these records? I've got a transaction id "TX-1234-abcd", a ...
0
votes
1answer
248 views

Deadlock : Behaviour of NOLOCK

We are running into deadlocks when we run concurrent instances of following query : BEGIN TRAN IF NOT EXISTS (SELECT TOP 1 * FROM Table1 WITH (NOLOCK) WHERE Col1 = Val1 AND Col2 = Val2) BEGIN ...
4
votes
2answers
483 views

Lock escalation problem on a trigger

I've inherited a SQL Server 2005 database that is getting 2-3 deadlocks a day. I've tracked it down to a scheduled job that runs during the day and inserts into a table with a trigger. The trigger ...
0
votes
1answer
137 views

Oracle transactions deadlock

How to rollback all active transactions on Oracle DB? I execute query and see 4 transcations in ACTIVE status. SELECT * FROM V$TRANSACTION
1
vote
1answer
248 views

How can I make a select statement get blocked?

Hello I am trying to intentionally make a SQL select statement get blocked by another simple SQL delete or update statement, for the purpose of learning. I prefer only InnoDB tables. To prepare the ...