Questions tagged [database-locking]
129 questions
0
votes
1 answer
Oracle Lock , How do they differ?
What is the difference between the below two erros.as far as i understood, they happen in case of a Lock. But do you know the differene in scenarios where one might occure.
ORA-04021: timeout occurred while waiting to lock object
and
ORA-00054:…

Divya MV
- 2,021
- 3
- 31
- 55
0
votes
1 answer
How to prevent locks in redshift. ( Shared lock stopping a write job)
I have a data warehouse which are used by multiple downstream users. They read the data from the redshift table. When they read the data, there is a shared lock enforced on the table. At that time, my daily job which is supposed to write on the…

Aravind
- 1
0
votes
1 answer
Postgresql lock for insert only
I have two tables in postgresql:
table A: has the definitions for a certain object
table B: has the instances of the objects defined in table A
Table A has columns total_instances and per_player_instances, which can both be null, and which I need…

Patrick Larrivee-Woods
- 35
- 1
- 8
0
votes
0 answers
Can two applications access the same record at once from same databse with READLOCK?
I have a java application and when two instances of the application trying to start at once, i get the following error.This is mainly because both are accessing the same record.But isn't ReadLock is shared therefore multiple users can access it at…

sam1295
- 3
- 2
0
votes
1 answer
Does oracle allow Select on table when whole table is locked by delete sql
When oracle executes a delete sql(with no where clause), it locks the whole table. So while the data is getting deleted from a table by a particular user session and if during that time period, will oracle allow any other user sessions to read data…

Reena Upadhyay
- 1,977
- 20
- 35
0
votes
0 answers
Spring Batch tables cleanup takes forever
For an application based on Spring Boot and relying on a PostgreSQL 9.6 database, I'm using Spring Batch to schedule a few operations which must take place every n seconds (customizable but usually ranging between a few seconds and a few minutes);…

AV FMX
- 45
- 1
- 1
- 7
0
votes
1 answer
Does Mysql use exclusive locks by default when doing UPDATE queries?
Environment : Mysql5.7 InnoDB
A Connection
start transaction; --> <1>
SELECT * FROM table_a WHERE id = 1 lock in share mode; --> <2>
B Connection
UPDATE table_a SET name = 'blah' WHERE id = 1; --> <3>
Function Flow : <1> -> <2> -> <3>
Conclusion…

henry-jo
- 283
- 1
- 3
- 14
0
votes
1 answer
pg_locks table has lot of simple select statements
we are connecting to our Postgresql (RDS) server from our django backend as well as lambda, sometimes django backend queries time out and I run the following query to see the locks:
SELECT
…

EralpB
- 1,621
- 4
- 23
- 36
0
votes
0 answers
Sidekiq worker writting in mysql performing better when single threaded
I am using sidekiq to perform concurrently some kind of service, this service performs an INSERT on table1 in mysql database. I noticed that on average my worker is performing way faster when I actually have one single thread running for the related…

David Geismar
- 3,152
- 6
- 41
- 80
0
votes
1 answer
How to handle multiple inserts into a table which generates auto increment primary id?
I am using the mySql database to store the user details in table User during registration.
User table has column ID autoincrement primary key.
I understand if two Users register at the same time, two requests are queued at the database. Puts a…

Pradeep Charan
- 653
- 2
- 7
- 28
0
votes
2 answers
SQL row locks and transactions
I’m really new to relational databases. I’m working on a project that involves finances and so I want any actions that affect balance not to occur at the same time and I want to achieve that using locks, however I’m not sure how to use them. Vision…

zabbir
- 59
- 5
0
votes
1 answer
Postgres: order of `FOR UPDATE OF table` retrieval
I'm wondering about data consistency when relying on FOR UPDATE OF in a JOIN. I'll try to make a simple example:
Transaction 1 does:
BEGIN;
SELECT 1 FROM a WHERE a.id = 5 FOR UPDATE;
UPDATE b SET val = 'other' WHERE b.a_id =…