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

0
votes
0answers
38 views

Can a critical section cause deadlock in SQL Server? [duplicate]

We get the next ID for our tables from a separate table with two columns, TABLE_NAME and NEXT_ID. We have a stored procedure which reads the NEXT_ID and then adds an increment to the NEXT_ID. The work ...
0
votes
0answers
24 views

2PL and Real Application Contest, a 2013 Questions? [on hold]

In 2PL (two phase locking), what advantage(s) does the rigorous model have over the strict model? I) There is no advantage over the strict model. II) In contrast to the strict model, it ...
0
votes
1answer
46 views

SQL Server Deadlock on delete

I have a query like this: with xx as ( SELECT [FilePath], ROW_NUMBER() over (partition by [FilePath] order by [FilePath]) as RowNumber FROM [dbo].[foo] ...
0
votes
1answer
24 views

How does PostgreSQL decide which query to cancel during deadlock cleanup

I know that PostgreSQL will detect and clear deadlock once it happen by cancelling one of the queries. How does PostgreSQL decide which one to cancel? Is this deterministic or there is some randomness ...
1
vote
0answers
52 views

SQL server deadlock graph explained

I am testing a scenario or recurrent request that ends up in executing the following store procedure simultaneously ALTER PROCEDURE [dbo].[clear_class]( @classID [int]) AS BEGIN DELETE FROM ...
0
votes
1answer
47 views

Please help in understaning DeadLock Graph

<deadlock-list> <deadlock victim="process46d288"> <process-list> <process id="process46d288" taskpriority="0" logused="9968" waitresource="PAGE: 14:1:4468703" ...
1
vote
1answer
52 views

Deadlock scenario, where is this S lock coming from?

I am encountering the below deadlock scenario. Please see the attached object definitions and execution plans. The plans were pulled out of cache from a system where this deadlock does occur. I ...
2
votes
1answer
62 views

How is it possible that two deletes give a deadlock, if they do have different primary key data

I am getting a deadlock by the same delete stored procedures that is called by two different threads for deleting two concurrent records. The deadlock happened on the primary key index of the X ...
1
vote
2answers
48 views

Understanding deadlock XML

Recently a clients website has been receiving many deadlocks. The website and CMS is custom built on asp.net MVC 3. The database is SQL Server 2008. I believe this started occurring when there was ...
1
vote
0answers
37 views

InnoDB Deadlocks Involving Currency Transactions

We're dealing with InnoDB deadlocks that are affecting our virtual transaction system. LATEST DETECTED DEADLOCK 150210 20:51:03 *** (1) TRANSACTION: TRANSACTION 0 4240405649, ACTIVE 0 sec, process no ...
0
votes
2answers
46 views

Where deadlock happen in mysql

I am unable to read below logs of mysql after executing SHOW ENGINE INNODB STATUS command. Can anyone please help me out where the deadlock has happen? ------------------------ LATEST DETECTED ...
6
votes
4answers
1k views

Are deadlocks a serious problem? [closed]

I have a few production SQL Server instances and I get around 100 deadlock alert emails a day (up to 100 for one server, 150 in total). Is this a problem I should investigate? How many deadlocks are ...
1
vote
1answer
70 views

What happens if two mySQL queries both try to lock the same row at the same time?

So this isn't exactly my strong suit, but here's my basic understanding of the situation: If two threads of the same application both try to execute the same query at the same time, mySQL will ...
2
votes
0answers
43 views

When does SQL Server acquire locks?

The list of isolation levels in SQL Server found here states that write locks acquired within a transaction are retained until the end of the transaction. However it doesn't mention anything about ...
0
votes
1answer
193 views

Deadlock caused by INSERT trigger - thread looking for lock it already has?

Using MySQL 5.6.17. I have a table with an INSERT trigger that reads values from that table and 4 other tables, combines the results and writes that to a sixth table. Ever since I added this trigger, ...
3
votes
1answer
119 views

Deadlock due to concurrent updates (with SIU lock)

We have 2 different wcf services which get invoked by a windows service. The methods in those wcf services are updating the same table inside different stored procedures. One thing is for sure: ...
3
votes
1answer
84 views

enabling snapshot isolation level on a database - what to monitor?

I am having problems with frequent deadlocks on a subscription database. I am considering enabling the snapshot isolation level for that database. I am aware that there is an overhead on the tempDb ...
1
vote
1answer
146 views

table partition in order to solve frequent deadlock issues - how would I know if it will work?

I use sql server 2005 enterprise edition and have a subscriber DB - part of a transactional replication - that is used for Business Intelligence purposes - they run reports out of it, and SSIS ...
10
votes
2answers
151 views

SQL Server Index Update Deadlock

I have 2 queries which when run at the same time are causing a deadlock. Query 1 - update a column which is included in an index (index1): update table1 set column1 = value1 where id = @Id Takes ...
2
votes
1answer
74 views

View last several innodb deadlocks

I see that I can view the latest deadlock in mysql/innodb, but is there a way to view past deadlocks? We have two deadlock issues, one being important and the other not. The less important deadlock ...
0
votes
1answer
110 views

MySQL InnoDB Deadlock For 2 simple insert queries

I have a deadlock for this two insert queries: insert into PlayerClub (modifiedBy, timeCreated, currentClubId, endingLevelPosition, nextClubId, account_id) values (0, '2014-12-23 15:47:11.596', 180, ...
1
vote
1answer
69 views

MySQL Latest Deadlock Explanation

Can someone explain this deadlock to me? It seems as if there are 2 inserts happening within milliseconds of each other with the same Primary Key. I'm not sure how this can cause a deadlock. At most a ...
0
votes
0answers
27 views

MySQL what is the order of the table lock for this query?

An example query looks like this: INSERT INTO Adventure (sword, fighter, quest) SELECT Swords.id, Fighters.id, Quests.id FROM swords Swords, fighters Fighters, quests Quests WHERE Swords._id = ...
1
vote
1answer
169 views

How many rows will be locked by SELECT … ORDER BY xxx LIMIT 1 FOR UPDATE?

As was asked on stackoverflow but then for MySQL, I was wondering how this works in PostgreSQL. How many rows get locked when I do a "FOR UPDATE" in combination with a "LIMIT", a "ORDER BY" and some ...
0
votes
0answers
90 views

How to fix deadlock caused by “X” locks on same resource?

I have the following <resource-list>: <resource-list> <keylock hobtid="72058301601677312" dbid="7" objectname="myDatabase.dbo.TableOne" indexname="PK_TableOne" id="lock2c336fb380" ...
5
votes
0answers
403 views

Trace Flag 1222 Not Working?

I have a customer site with two similarly configured 2008r2 SQL Servers "A" and "C". On both servers the trace flags 1204 and 1222 are enabled and DBCC tracestatus shows the following on both ...
1
vote
1answer
123 views

Deadlock detected on CREATE TABLE in PostgreSQL

I'm creating multiple tables asynchronously when I get deadlock detected. Both tables (Table A & B) have FK to one table (Table C) and I get deadlock on relation to Table C. Scripts CREATE TABLE ...
3
votes
2answers
152 views

Insert only deadlocks

We have an application inserting data into a table. Unfortunately, we are getting deadlocks and the deadlocks are coming from inserts only. We are seeing the inserts take key locks in a different ...
5
votes
1answer
150 views

Should an INSERT cause an exclusive lock on a foreign key?

I'm working on a deadlock issue. Process A is doing a simple INSERT into TableA which has a FK to TableB Process B is doing a complicated SELECT on a join that includes TableA and TableB I'll ...
2
votes
0answers
198 views

Why does a simple select query produce a deadlock? [closed]

I am trying to analyze randomly occurring deadlock problems on an SQL Server 2008 R2 database. The deadlocks occur in very rare cases when SSRS tries to access one of 5 different stored procedures. ...
0
votes
1answer
188 views

Weird deadlock graph

I got a deadlock graph that I cannot completely understand. This is the deadlock graph xml (table names obfuscated, obviously): <?xml version="1.0" encoding="utf-16"?> <deadlock-list> ...
2
votes
0answers
88 views

Deadlock when CODES table has 41900 rows

I'm having a deadlock accessing the same table from two different jobs. I'm testing it on a SQL SERVER 2012 Enterprise edition. Running SQL Profiler I get this graph: You can find the SQL Server ...
0
votes
0answers
141 views

notification email when deadlock is encountered in alert log,oracle

how to send a notification email when deadlock is encountered in alert log on any node like the deadlocks encounterd below (an alert any time a deadlock is detected in alert log.) Node 1: Mon Sep ...
0
votes
0answers
75 views

InnoDB says I'm in Deadlock when it should not be

I'll do my best to explain the situation. I'm at a complete loss. Preliminaries I'm running a Java Web Application in Tomcat 7.0 using a JDBC Connector to communicate with my MySQL Database. The ...
1
vote
1answer
275 views

InnoDB deadlock with INSERT .. SELECT

I am trying to understand why a deadlock occurs when two workers in parallel are running INSERT .. SELECT queries on a table which has both 1) auto incremented primary key, 2) a unique index on ...
0
votes
2answers
186 views

Getting a Deadlock,

I have this code : public void saveItems(List<Pair<Item, MapleInventoryType>> items, int id) throws SQLException { PreparedStatement ps = null; PreparedStatement pse = null; ...
0
votes
0answers
39 views

Is it possible for a SELECT-only stored procedure to deadlock on itself?

Environment is Microsoft SQL Server 2012. Is it possible for a stored procedure consisting exclusively of SELECT statements to deadlock on itself? That is the report I am getting from a vendor for ...
2
votes
2answers
317 views

Help reading deadlock XML

Even with reading the Bart Duncan blog about reading deadlocks I still struggle with this. I have included the XML from a particular deadlock. <?xml version="1.0" encoding="utf-8" ?> - ...
5
votes
1answer
434 views

Why are U locks required when using Read Committed Snapshot Isolation

I consider myself a beginner at Sql Server locking. My understanding is that when using RCSI, Sql Server doesn't need to issue S locks because it uses row versioning (in most cases). From ...
10
votes
1answer
441 views

Resolving deadlock from 2 tables only related through indexed view

I have a situation where I'm getting deadlocks, and I think I've narrowed down the culprits, but I'm not quite sure what I can do to fix it. This is on a production environment running SQL Server ...
3
votes
2answers
364 views

Deadlock with simple queries in sql server 2008

I have an application that must delete and insert registries from a table, the table is storing the historic registries for an access control and is stored with the datetime for the check in the ...
0
votes
0answers
57 views

Innodb Deadlock During Insert

What could be the reason behind 2 inserts causing a deadlock? Here is what I get from log file: *** (1) TRANSACTION: TRANSACTION 6CA06B9, ACTIVE 6 sec inserting mysql tables in use 1, locked 1 LOCK ...
1
vote
0answers
85 views

Ordering a sequence of INSERT…SELECT statements to avoid a deadlock

I have the following two tables in a MySQL database: CREATE TABLE `names` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(60) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY ...
1
vote
1answer
83 views

Deadlock while updating rows and inserting new ones

I'm working with SQL Server 2012 Express Edition and I getting this error: Transaction (Process ID 53) was deadlocked on lock resources with another process and has been chosen as the deadlock ...
4
votes
1answer
461 views

Optimizing concurrent updates in Postgres

I'm running concurrent Postgres queries like this: UPDATE foo SET bar = bar + 1 WHERE baz = 1234 Each query affects the fixed K number of rows, and I can't find a way to enforce the order in which ...
1
vote
0answers
646 views

exec sp_getapplock - Different behaviour using go or without go

we have a strange behaviour while using sp_getapplock (we tried to use this to solve a problem with a deadlock involving some insert while another session was trying to execute a ALTER SWITCH ...
1
vote
1answer
165 views

TRUNCATE in transaction: dead lock

In a unittest we run this: BEGIN; TRUNCATE table1; TRUNCATE table2; ... UPDATE ...; ROLLBACK; Unfortunately this results in a dead lock if a cron job starts and this job operates on table1 and ...
4
votes
0answers
536 views

SQL Server Deadlock - Two SELECT Exclusive Locks on Exact Same Index and Key [closed]

How is the deadlock graph below possible? How did two SELECT statements simultaneously acquire an exclusive lock on the exact same resource? The exclusive locks were on the primary key index for ...
8
votes
1answer
1k views

Deadlock on Delete Statement

I get a deadlock when a SQL Server Job runs. The deadlock occurs on a simple DELETE statement. I would have thought there would have to be a SELECT/UPDATE query running to cause the deadlock? But ...
0
votes
1answer
167 views

Is UDPLOCK using Row-locks?

I have a UPDATE statement that is using a UPDLOCK inside a DTCTransaction to avoid deadlocks. Now I was wondering. is it locking on a Row-level or on a Table-level?