641 questions
0
votes
0
answers
20
views
Hitting LockAcquisitionException in my /save API
My website has a form with multiple sections which will call /save API every time user click next page / next section, so the API is often triggered. And when the API is triggered frequently within a ...
0
votes
0
answers
50
views
db2 dead lock on delete with FK constraint
I have 2 tables, Movement and Movement_encoded_names, Movement_encoded_names has a FK movementId pointing to Movement table.
Deadlock happens when I call JPARepository.deleteByMovementNumber(String ...
0
votes
0
answers
95
views
SqlBulkCopy with concurrent request Deadlock issue in C#
I'm using SqlBulkCopy with my application and trying to insert bulk 1000000 records in single table.
But the approach is 10 parallel threads will hit with bulk command on same table with 100000 record ...
1
vote
1
answer
43
views
Contradiction in MySQL manual regarding deadlocks
In the MySQL manual, in the section Deadlocks in InnoDB, it states:
The possibility of deadlocks is not affected by the isolation level, because the isolation level changes the behavior of read ...
0
votes
0
answers
32
views
Deadlocks with a where query that has indexed columns [duplicate]
I am facing an issue where two of a my transactions results in a deadlock but both of them have nothing in common. I believe mysql is locking some additional rows.
After running: SHOW ENGINE INNODB ...
0
votes
0
answers
36
views
Why can't Make Deadlock using select-for-update in mysql [duplicate]
My DeadLock Secenario.
-- emp_no is pk.
— Trasnaction 1
select emp_no from employees where emp_no between 1 AND 500000 for update;
— Transaction 2
select emp_no from employees where emp_no between ...
0
votes
0
answers
313
views
Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction
I am facing an issue with a deadlock but I'm failing to understand how both transactions are linked and causing the deadlock.
My log errors are as follows.
Transactiion 1:SQLSTATE[40001]: ...
0
votes
2
answers
103
views
T-SQL update deadlock concurrency issue
I have 2 jobs scheduled at the same time 9am both calling using a loop container which downloads a SSRS report per iteration, but the job reported a deadlock on a stored procedure used in the process ...
1
vote
0
answers
213
views
SQL Server 2022 Thread Safe UPSERT
I would like to do a thread safe update or insert (upsert) in SQL Server 2022.
I've tried to follow the guidlines in SQL Performance, the more classic MERGE statement as shown here and the TRY CATCH ...
0
votes
1
answer
72
views
Deadlock while Pessimistic Locking in Ruby on Rails
I get a deadlock error while pessimistic locking in Ruby on Rails.
Versions:
MariaDB: Docker mariadb:10.11
Ruby: ruby-3.3.0 via rvm
Rails: 8.0.1
MySql2: 0.5
I have a three instances of an RoR ...
1
vote
1
answer
108
views
SQL Server Deadlock Delete Insert Statement
Both a delete and insert (range) on the same table are causing a deadlock due to contention on the same primary key index. I don't understand why.
The locks taken are RangeS-S by each process and the ...
1
vote
1
answer
373
views
MySQL deadlock when using SELECT FOR UPDATE SKIP LOCKED?
I have a queue system built using PHP and MySQL (I initially built it using redis, but it was kinda complicated and not very flexible), and after doing some research I found out that since MySQL 8.0.1,...
0
votes
0
answers
62
views
How can I determine what TSQL code is executing on a blocked thread [duplicate]
We're chasing a repeated blocking/deadlock problem with a vendor's product, and I'm trying to get some clues to help point their development team as to what the issue might be. I'm currently using ...
0
votes
0
answers
82
views
Looking for assistance debugging a SQL deadlock
I am looking for some guidance on how to best debug this deadlock. I'm using EF Core and believe the line causing the issue is this: _context.InventoryTracks.Remove(id). This is the only place in code ...
2
votes
0
answers
661
views
Replicating ORA-00060: deadlock detected while waiting for resource
I am trying to replicate an issue we recently faced. We have a PL/SQL procedure that has the logic below:
procedure mark_records (p_request_id number)
is
begin
-- this marks which contracts ...
0
votes
0
answers
104
views
Blocking query using Entity Framework Core
I have an ASP.NET Core application, using Entity Framework Core, I am accessing my SQL Server database.
All of the sudden, in the last couple of days, an issue arose where there is a specific table ...
1
vote
0
answers
25
views
Concurrent Requests Creating Duplications for Users
I am facing an issue with concurrent requests resulting in duplicate entries. Our system checks whether a user exists and creates a new one if not, using middleware. However, when multiple concurrent ...
0
votes
1
answer
20
views
How does PieCloudDB detect if there is a deadlock?
I would like to know if PieCloudDB Database has a deadlock detection mechanism. What parameter settings can be used to turn on the deadlock detection function? Or what views can I use to check the ...
1
vote
0
answers
97
views
PostgreSQL / MariaDB, isolation differences
The following sequences of SQL statements are executed on two different connections to the same database.
1: START TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1: UPDATE Person SET LastLogin=NOW() WHERE ...
0
votes
0
answers
180
views
Blocking caused by OLEDB in SQL Server
I created several views on SQL Server whose task was to retrieve data from an Excel file (1 view from a different data source/Excel file) whose purpose was to synchronize the data in the database with ...
1
vote
1
answer
131
views
SQL Server deadlock and two entries for the same keylock in resource-list section in XML file
<resource-list>
<keylock hobtid="72057616768958464" dbid="16" objectname="Orders"
indexname="PK_Orders" id="...
2
votes
0
answers
325
views
RateLimiter is causing a 1213 deadlock in laravel (mysql)
I'm using Laravel 10 with MySql 8.0.35 and have a fairly basic api limiter which governs the use of a webhook. Most of the time it works. Sometimes, it generates a database deadlock. This is the ...
1
vote
1
answer
870
views
SET TRANSACTION ISOLATION LEVEL inside mariadb event
I have a mariaDB event that runs every hour and copies data from multiple tables to others. Since I'm using INSERT INTO SELECT, and one of the tables is quite big, I end up having deadlocks, because ...
0
votes
0
answers
83
views
Inno DB / MySQL deadlock with two UPDATE statements to the same table but different rows
Executing show engine innodb status shows deadlocks between the following two queries:
update `transparency_codes` set `shipment_id` = 1265, `transparency_codes`.`updated_at` = '2024-05-08 17:45:30' ...
0
votes
1
answer
121
views
mysql: Deadlock inside stored procedure
I have stored procedure like this:
DECLARE err_code CHAR(5) DEFAULT '00000';
DECLARE msg TEXT;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
GET DIAGNOSTICS CONDITION 1
err_code = ...
0
votes
2
answers
58
views
Postgres locks and deadlock questions
I have a postgres table:
CREATE TABLE clicks (
page_id UUID REFERENCES pages (id) ON DELETE CASCADE,
status TEXT NOT NULL,
click BIGINT NOT NULL,
...
0
votes
0
answers
195
views
com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Deadlock found when trying to get lock; Similar exception for SQL Server
When I am trying to update row with MySQL database. I am randomly getting MySQLTransactionRollbackException exception. For that I have written retry code in
catch (MySQLTransactionRollbackException ...
0
votes
2
answers
119
views
Drawbacks of custom save method to avoid user getting a userprofile_id with a specific value. (Django/Heroku)
In my Django project, I need to avoid users creating a userprofile_id with a value of 3 (3, 13, 203...).
This is an interim workaround another issue which will probably take longer to resolve.
I ...
0
votes
1
answer
84
views
Single query throwing deadlock error after updating a record
I have a query that is being run across multiple micro-services, and due to that it is possible (expected) at times to deadlock.
const reserveActionForExecution = async (id: number): Promise<...
1
vote
0
answers
197
views
Spring shedlock table update row commit getting failed when the backend DB (Mysql InnoDB cluster) is running in multi-primary mode
A spring boot microservice deployed in OCP and makes connection to the backend database using mysql-router image. This service contains a scheduler class (using @scheduled annotation) to do certain ...
0
votes
1
answer
413
views
Async SELECT statements causing deadlock on a SQL Server temp table
We have an application making an async database connection in C# that is attempting to run two SELECT statements at the same time. Both statements are referencing the same temp tables but are only ...
0
votes
0
answers
70
views
deadlock scenario for locking update with sorted list
assume a tableX having following schema
id,colA,colB,colC,colD
composite index -> colA,colB,colC
there is list of object and each object has field ColB and ColC, the list is then sorted
list = ...
2
votes
1
answer
1k
views
PostgreSQL15. ProcSignalBarrier deadlock in DROP TABLESPACE
I creating a tablespace
create tablespace test_tablespace location '/path/to/tablespace/dir';
Next, I create a table and fill it with data
create table test_table (id numeric, file_name varchar) ...
1
vote
0
answers
116
views
how to deliberately cause deadlock in test cases to guard concurrent bug steadily?
Imagine I have a complex test case which can cause two threads deadlock occasionally. It's not suiteable, I think, to run in CI for guarding concurrent bugs. I want to write a simple test case to ...
0
votes
0
answers
169
views
MySql 'show engine innodb status' truncating queries in output. (Attempting to solve Deadlock issues)
I have been trying to solve some MySQL deadlock issues using show engine innodb status.
Our platform uses Google's Cloud SQL and the offending SQL queries in the Innodb Monitor is truncating the ...
0
votes
0
answers
146
views
Prevent deadlocks in multi threaded environment when using Oracle Update clause
I have a multi threaded application connecting to Oracle 19c DB. There is a process table where another application is constantly writing new records. Purpose of the threads in app is to pickup ...
2
votes
0
answers
1k
views
TimescaleDB: How to avoid deadlocks on hypertables with a compression AND retention policy during SELECT?
I am getting deadlocks from postgres occasionally when attempting to execute a SELECT query on a hypertable with both a compression and retention policy.
From the logs, it looks like the deadlock is ...
1
vote
1
answer
116
views
Deadlocks caused by concurrent deletes on different rows on SQL Server
I need some help to understand this deadlock scenario. We have concurrent deletes on a table. The operations deletes a record and insert a new one in a transaction (other tables are involved but no ...
0
votes
0
answers
364
views
A deadlock caused by the duplicate-key error, "X insert intention waiting ... X locks rec but not gap" vs "S locks rec but not gap waiting"
I am debugging a deadlock caused by the duplicate-key error. According to MySQL document,
If a duplicate-key error occurs, a shared lock on the duplicate index
record is set. This use of a shared ...
1
vote
1
answer
578
views
MySQL: SELECT ... FOR UPDATE creates unexpected deadlock
Our application performs multiple identical requests using SELECT … FOR UPDATE and ends-up deadlocking each other. I thought using FOR UPDATE should serialize the request, forcing the second one to ...
0
votes
1
answer
1k
views
SQL Server deadlock on read uncommitted isolation level
I get error message "Transaction (Process ID 60) was deadlocked on lock resources with another process ...". I have two simple queries like:
Query 1:
BEGIN try
SET TRANSACTION ISOLATION ...
0
votes
1
answer
239
views
How to make DB::transaction wait between tries?
I have a scheduled import process that is run queued in a background.
Each iteration is complex enough to better be run in transaction to keep data consistent.
Everything goes well while process ...
1
vote
1
answer
2k
views
psycopg2.errors.DeadlockDetected: deadlock detected
PROBLEM
I have a batch Job that runs when user updates a row the UI. User is allowed to update multiple rows simultaneously which will trigger multiple batch jobs each with a unique run_id .
This job ...
0
votes
0
answers
135
views
EF Core 5: Temporal table update deadlocks with subsequent stored procedure call accessing that table
Our application experiences occasional deadlocks when updating a record in a temporal table and then invoking a stored procedure that accesses that table in a temporal way.
The application is using EF ...
2
votes
1
answer
924
views
ActiveRecord::Deadlocked: PG::TRDeadlockDetected: ERROR: deadlock detected
Getting Postgresql Database deadlock error in ruby on rails while updating multiple records at once
ActiveRecord::Deadlocked: PG::TRDeadlockDetected: ERROR: deadlock detected DETAIL: Process 140501 ...
0
votes
0
answers
109
views
How to deal with deadlock happened because of range lock on sql server
Table name : Outbox
Ways of insertion:
We have service which does bulk inserts to Outbox table using async
await and dapper(InsertAsync).
Also we have another process which has SP to inserts data to ...
4
votes
1
answer
1k
views
Deadlock when using SELECT FOR UPDATE with WHERE IN clause
Consider the following example:
-- Transaction 1 -> T1
BEGIN;
SELECT * FROM table1 WHERE id = 1 FOR UPDATE;
SELECT * FROM table1 WHERE id = 2 FOR UPDATE;
UPDATE table1 set col1 = 'abcd' where id = ...
1
vote
0
answers
406
views
BatchUpsert with Golang and Gorm deadlock in concurrency goroutines
I want to get data from one table periodically and analyze it, then dump it to another table.
In the way I did not use parallelism, it was slower and without problems. Therefore, I want to change to ...
0
votes
0
answers
149
views
SQL Server 2016 deadlock issue
In one of my production environment, I am seeing deadlocks on daily basis. Please help me out to fix the issue.
Enabled traceflag and captured deadlock graph. Tried to understand the graph and I ...
1
vote
1
answer
87
views
Find out deadlock reason
We have NUnit project witn tests and many cases for each test. All of them run in parallel mode.
I found 2 deadlock reasons. 1 - is table, but second one - no name or some id.
How to find this object?
...