Relative Content

Tag Archive for mariadbinnodbdeadlock

Weird deadlocks on simple queries

I receive data from a remote server via HTTP POST requests in JSON format which I save for later processing in a database table. Occasionally I encounter deadlock errors doing so. The data is unique per an identifier, so before inserting a new data set, I delete any old ones already present in the table. To avoid data loss in this process, I use a transaction, so the queries look something like this: