Database concurrency is a database property that allows users to access data at the same time.
Questions tagged [database-concurrency]
148 questions
0
votes
0 answers
Concurrency control for table generated Transaction Id
I have a system in which I generate the transaction ids based on a table. The number must have a specific format therefore using database sequences is not an option. Moreover, the number transactions types is variable which means creating variable…

Saleh Omar
- 739
- 2
- 8
- 29
0
votes
2 answers
While the server is under more strain, queries become slower
How can I improve the following query's performance while the server is loaded? I've created a combo index and removed the index from the table because it's not picking it up, but is there another way to do it? , Normally I run the below query it…

RRQ
- 91
- 6
0
votes
1 answer
Conditionally preventing inserts from other concurrent transactions until the specific transaction finishes
I'm currently using Postgres 14 and have a problem related to concurrency control.
Let's say we have 2 transactions. Transaction A and transaction B. Transaction A acquires exclusive locks on multiple tables and transaction B has to wait until the…

m1k1
- 3
- 1
- 2
0
votes
0 answers
Is updating with where clause safe operation (can it prevent lost updates) in Postgresql?
For example, to prevent two users concurrently updating the same wiki page, you might try something like this, expecting the update to occur only if the content of the page hasn’t changed since the user started editing it:
UPDATE wiki_pages SET…

Iakov Burtsev
- 377
- 1
- 2
- 15
0
votes
0 answers
How many message delays does two-phase locking requires to commit a txn in normal case?
I read some tutorials on two-phase commit
https://www.cs.cmu.edu/~dga/15-440/F10/lectures/Concurrency-Control.pdf [Slide 27]
It seems that, when there are multiple shards [participants], it needs 4 message delays for the coordinator to commit the…

steamgjk
- 11
- 1
0
votes
1 answer
AWS RDS Concurrency Question (multi-user)
I am trying to build a desktop application and ideally connect to AWS RDS (MySQL) database. My use case is that at least 5 users will be using this app at the same time and be writing into the database at the same time likely. My question is does…

DLW
- 121
- 1
- 2
- 8
0
votes
1 answer
asp:SqlDataSource with ROWVERSION (TIMESTAMP)
I ran into .NET (Framework, w/ WinForm and WebForms) / MS SQL project where significant tables in the database contain a TIMESTAMP (aka ROWVERSION) column (called tsModified) to prevent concurrency issues. Additionally, this project does not allow…

Ted Krapf
- 403
- 3
- 11
0
votes
1 answer
Spring application 300 TPS bottleneck
I have a Java application running on Spring with a service that creates an invoice, each invoice has 10 read and writes. However we cannot get it to pass the 150TPS (transactions per second), hardware doesnt reach 30% capacity and we have set…

Schopen
- 1
- 2
0
votes
1 answer
How to implement row level locking
This is not working for the row level locking
I just want to know if I can select the row like
select * from table where folder like %344443%**
then update the row with
update table set folder = '{"bin":"44456","venv":4366}' where id =…

sharad madeshiya
- 1
- 1
0
votes
1 answer
How to achieve data concurrency on MySQL database's single user but multiple simultaneous login sessions?
I have a MySQL server's database on cloud say empdb.
This server has only one user (who has all admin privileges) say empdb_admin with password
I created an application which logs in the database using this login and it can perform CRUD activities…

Sushant
- 165
- 7
0
votes
0 answers
MongoDB and concurrency
I am wondering if the following is achievable in MongoDB. I am building a simple REST API and one of the functionality's it will offer is to update a field in multiple documents using Mongoose and the updateMany() function.
Reading this:…

SomeDutchGuy
- 2,249
- 4
- 16
- 42
0
votes
0 answers
Database operation expected to affect 1 row(s) but actually affected 50(db sequence next number) row(s)
I use entity framework 2.2.6. I have AddOrUpdate method. When client try to operate(insert or update) on entity I check if entity exist on db by unique values and I set old data id value to new data id value and I set it as updated. If not exist I…

Babək
- 23
- 1
- 9
0
votes
0 answers
Cannot find cause of concurrency issues
I am getting a concurrency violation on my updatecommand when I try to save a datatable back to the database. I have spent hours trying to find a solution but it escapes me. I am changing one column in about 90% of my rows in a 4200 plus row…

Brad
- 35
- 5
0
votes
0 answers
duplicate row insert when using transaction and DbUpdateConcurrencyException happen
I have a problem when I insert and update data. If a DbUpdateConcurrencyException happens then there are two inserts.
Here is the table
[Table("Wallet")]
public partial class Wallet
{
public decimal ID { get; set; }
…

Byron
- 1
0
votes
1 answer
How to handle concurrent access in mysql?
If a shopping site only has 1 product available and 2 people try to buy it at the same time, who will get the product? How will the server prioritize the user."curious about flash sale on amazon,flip kart". which algorithm?

able roy
- 9
- 3