I’m trying to create a waiting list in Postgres. Minimal code: status is important, because I want to be able to notify users when they are applied after waitlisted. But don’t want to notify them based on that they are in the first n position if they wasn’t waitlisted at all. Services are limited to a given number of users.
Tag: deadlock
PostgreSQL: deadlock without a transaction
I have a route (in a node JS app) that inserts and updates some data in a PostgreSQL database (version 13). In pseudo-code, here are all queries that are done in sequential order: On some instances of the app without that much traffic that writes on their own table, I have many deadlocks. I don’t understand why since there is
MariaDb InnoDB deadlock while doing many inserts
I’m having deadlock issues with a MariaDB (10.0.27)if it’s under pressure. The database schema is basically a hierarchy and the leaf node causes this: This is how my leaf table looks like: I’m able to reproduce the deadlock with an input set that puts the system under pressure. With this, I’ve been playing around and once I remove the unique
What determines the locking order for a multi-table query?
Does the SQL standard specify the locking order for a multi-table query? For example, given: Does the SQL standard guarantee a locking order or is it determined by the (implementation-specific) execution plan? Is there a way to guarantee a locking order? If there is no way to guarantee locking order, how are we supposed to prevent deadlocks? UPDATE: Please do
How to simulate a deadlock in SQL Server in a single process?
Our client side code detects deadlocks, waits for an interval, then retries the request up to 5 times. The retry logic detects the deadlocks based on the error number 1205. My goal is to test both the deadlock retry logic and deadlock handling inside of various stored procedures. I can create a deadlock using two different connections. However, I would
How to troubleshoot ORA-02049 and lock problems in general with Oracle
I am getting ORA-02049 occasionally for some long-running and/or intensive transactions. There is seemingly no pattern to this, but it happens on a simple INSERT. I have no clue how to get any sort …