Questions tagged [database-locking]

129 questions
4
votes
0 answers

QSQLite Error: Database is locked

I am new to Qt development, the way it handles threads (signals and slots) and databases (and SQLite at that). It has been 4 weeks that I have started working on the mentioned technologies. This is the first time I'm posting a question on SO and I…
4
votes
4 answers

How do I ensure a model always uses a transaction and locks (in Rails)?

I noticed that Rails can have concurrency issues with multiple servers and would like to force my model to always lock. Is this possible in Rails, similar to unique constraints to force data integrity? Or does it just require careful…
Chloe
  • 25,162
  • 40
  • 190
  • 357
3
votes
1 answer

How can user_tables get locked on Oracle?

I have a traceback from a machine where the following query seemed to get hung for days: SELECT table_name FROM user_tables What could possibly generate such a lock? Users can never modify this table; and there were plenty of subsequent instances…
David Fraser
  • 6,475
  • 1
  • 40
  • 56
3
votes
1 answer

PostgreSQL error : process still waiting for AccessShareLock on relation 2676 of database 0

We are not able to connect to a PostgreSQL instance and we have to restart the PostgreSQL service to connect to the instance, but we start getting the same error within a few days. Logs show below error 2019-02-18 08:00:03.043 UTC [5053]…
YogeshR
  • 1,606
  • 2
  • 22
  • 43
3
votes
1 answer

Will an UPDATE ... WHERE transaction in MySQL lock rows in other tables referenced from subqueries?

When issuing an UPDATE statement in MySQL (using InnoDB and the REPEATABLE READ isolation level) containing a subquery like this: UPDATE bar INNER JOIN (SELECT i1, i2 FROM foo) inner ON bar.b1 = inner.i1 SET bar.b2 = inner.i2) Will the…
lxgr
  • 3,719
  • 7
  • 31
  • 46
3
votes
1 answer

Hibernate delete/insert database blocking lock

We are using Hibernate 3.6.1.FINAL against Oracle 11g. We are experiencing blocking locks in our database that I believe is caused by an unexpected side-effect of Hibernate. This is a critical issue we need to resolve, as the database blocking…
Philip Tenn
  • 6,003
  • 8
  • 48
  • 85
3
votes
1 answer

Multiple database connections in Android (from Activity and Service)

I would like to use a SQLite database to store data in an Android application. No problem. But at predefined intervals (every day at 10, 14, 18 and 22 o'clock), I want to run an IntentService that requires access to the database as well. And here…
caw
  • 30,999
  • 61
  • 181
  • 291
2
votes
1 answer

SQL Server 2008 stored proc running concurrently causing delays

I have a problem where it seems that when running the same stored procedure at the same time from two different instances of the same application it is timing out, and wondered if there was anything I could do to resolve it? I believe the problem…
2
votes
1 answer

Sqflite get locked on bulk insertion even after using transaction object and batch

I am new to flutter and I am doing bulk insertion in sqflite database. I have tried using both transaction and batch objects but my issue still remains there and database gets locked. Here is what i am doing. Future> fetchShops()…
2
votes
1 answer

What is the Rails 6 Way to prevent multi-model logic from starting if it's already running for a user?

I have some complex business logic that runs when a controller action is hit. The logic performs various updates to many different tables/records associated with a user. However, the model method called by the controller is prone to running multiple…
David Gay
  • 1,094
  • 2
  • 16
  • 32
2
votes
1 answer

How to lock a SELECT in PostgreSQL?

I am used to do this in MySQL: INSERT INTO ... SELECT ... which would lock the table I SELECT from. Now, I am trying to do something similar in PostgreSQL, where I select a set of rows in a table, and then I insert some stuff in other tables based…
Hommer Smith
  • 26,772
  • 56
  • 167
  • 296
2
votes
1 answer

pg_dump blocking Postgres database access with same user

We have a Django application running on Ubuntu using a Postgres DB on the same server. We are backing up our database every day with the following command: pg_dump -Fc -U user1 -w db_name > ${filepath}` The problem is that is seems to be blocking…
Storo
  • 988
  • 1
  • 7
  • 31
2
votes
1 answer

How to update different rows concurrently in Mysql

I have a large table in which I have to update several rows. I tried to use multiple threads to update different rows concurrently, but it seems MySql locks all the rows in the table instead of locking only those rows which are matched by 'where'…
2
votes
1 answer

Using django select_for_update without rolling back on error

I'm trying to utilize django's row-level-locking by using the select_for_update utility. As per the documentation, this can only be used when inside of a transaction.atomic block. The side-effect of using a transaction.atomic block is that if my…
DBrowne
  • 683
  • 4
  • 12
2
votes
1 answer

finding query that is holding lock

How can we find query and process id that is causing lock in DB2 10.5? We can find table and tablespace name for "get snapshot for locks on dbname" command. But I want know about query and process id.
Qazi
  • 23
  • 1
  • 3
1
2
3
8 9