Questions tagged [table-lock]
42 questions
1
vote
1 answer
Hibernate - apply locks to parent tables in polymorphic queries
I have two objects:
public class ParentObject {
// some basic bean info
}
public class ChildObject extends ParentObject {
// more bean info
}
Each of these tables corresponds to a differnet table in a database. I am using Hibernate to query the…

bogertron
- 2,255
- 1
- 24
- 36
1
vote
2 answers
Locking postgresql table
Is it possible to lock a table for a specified time in PostgreSQL database by running psql commands via shell script or sql file?
If we run the LOCK TABLE command, when the script exits the lock will also be gone, so that is not sufficient.

Ras Ram
- 173
- 1
- 7
0
votes
1 answer
"SET LOCAL can only be used in transaction blocks" warning in PostgreSQL
When setting lock_timeout 10 seconds locally on psql as shown below:
SET LOCAL lock_timeout = 10000;
I got the warning below on psql:
WARNING: SET LOCAL can only be used in transaction blocks
Then, SET LOCAL lock_timeout = 10000; doesn't apply to…

Super Kai - Kazuya Ito
- 22,221
- 10
- 124
- 129
0
votes
0 answers
SQL Server table data deletion while insertion is in progress in another session
I have a table (TableA).
There is a probability that more than one process may try to delete data from TableA and at the same time more than one process may try to insert data into same table i.e. TableA.
Will this result in table lock? If yes, how…

Mahendra Dhaker
- 43
- 8
0
votes
1 answer
How to remove a lock from a table in a Synapse Dedicated Pool?
There has been a lock on 2 different tables since last night. What is the query to remove a lock from a table in a Synapse Dedicated Pool?
Thanks in advance

v-jh
- 66
- 3
0
votes
1 answer
Temporal Table and Table locks
I am thinking of using a temporal table solution for one of our application, and want to read historic data while new data is being written. Can this cause table locks? I have millions of rows to query/maybe even insert/update/delete.

Emil
- 281
- 1
- 2
- 11
0
votes
2 answers
locking the same table with different aliases
I'm trying to lock all tables involved in a particular set of queries but one of the queries does a self JOIN to itself. How would I lock that one?
LOCK TABLES employees e READ,
employees e2 READ;
Superficially it seems like that should…

neubert
- 15,947
- 24
- 120
- 212
0
votes
1 answer
SQL Server - 2 sec inserts and 5 min archiving - How to avoid table locks?
I have an insert that is executed every 2 seconds (20 columns, 15000 rows, outside of SQL Server [sensor data]), it runs in 200 ms. I would like to keep only 10 minutes of data (sum ~4.500.000 rows) in this table then move (archive) the earliest 5…

MRK_S
- 9
- 1
- 3
0
votes
2 answers
innodb full table lock during simple insert
Our code does
insert into user (email, name) values ((),()) // 1000 rows at a time, without specifying primary key value
Such inserts run in parallel on multiple server and with high concurrency (sometimes even at 2 parallel) many of them fails due…

Rahul
- 824
- 1
- 12
- 27
0
votes
0 answers
lock issue on tables due to triggers
I am new to Triggers and am facing some lock issue on TransactionDateTracking table (duplicate entry message on inserting in TransactionDateTracking) ) when I used triggers. The following are the table structures
CREATE TABLE TransactionDateTracking…

ANUJ PANDIT
- 1
- 1
0
votes
0 answers
Laravel database lock table in concurrent request
I want to prevent my database to update if suddenly multiple requests send to my database and updated at the same times.
I create user Laravel Users Table as an example and use JMeter to simulate there are two users, sending concurrent request to…

Shiro
- 7,344
- 8
- 46
- 80
0
votes
1 answer
SQL Server: lock table during entire stored procedure
I have a streaming ingestion into my staging table. Every 5 minutes I execute a stored procedure to insert/update all the data from this staging table into my final table.
Process of the stored procedure:
BEGIN
- UPDATE RECORDS IN FINAL TABLE FROM…

Tjekkles
- 5,352
- 8
- 36
- 53
0
votes
1 answer
Is this insert safe?
I have project where I have to insert a bunch of records periodically (~5k record in 10 minutes periods) from a remote source. I have a staging table which has the same structure as the final target table (no primary key, id is varchar and not…

posthy
- 47
- 6
0
votes
0 answers
Lock tables in long stored procedure in Oracle
I have a stored procedure in oracle to delete rows from some 8-10 tables.
I have to delete a row from say table "Person". It has lot of relations like "Person_Health", "Person_Claims", "Person_Bills" etc. Again, the child tables has relations with…

sanjay Kumar
- 140
- 1
- 14
0
votes
0 answers
What is a proper way to perform a mysql transaction across different php files under the use of ajax or it is not possible?
The question is about ajax, mysql, select and update, transaction and locks etc., and sorry if I've put the background story so long but in order to understand my needs I think it is necessary. This is a long question but the need is simple so I…

Hang
- 355
- 3
- 19