Database concurrency is a database property that allows users to access data at the same time.
Questions tagged [database-concurrency]
148 questions
2
votes
1 answer
How to maintain database concurrency in long logical flows
We are using entity framework code first to save reports to SQL database, many of the objects have many to many relations so the data is split into different tables.
In order to prevent duplication of data we first check if a certain object is…

shlomie
- 21
- 1
2
votes
1 answer
Select for update query returns cardinality violation
We are running this query in Postgres 9.6.10 in a Google managed cloud DB:
WITH update AS
(UPDATE cart SET loyalty = loyalty || jsonb_insert('{}', '{coupon}', loyalty#>'{scan_coupon}' || $1) WHERE id =
(SELECT id FROM cart WHERE id = $2 AND…

CallMeNorm
- 2,299
- 1
- 16
- 23
2
votes
2 answers
Best way of managing database concurrency?
I've come to an issue when handling concurrency.
In the example below, two users A and B edit the same invoice and make different changes to it. If both of them click save at the same time I would like one of them to succeed, and the other one to…

The Impaler
- 45,731
- 9
- 39
- 76
2
votes
0 answers
EF Core Create database row if not exists
So I'm hitting my webservice to save a row in the database if the id doesn't already exist. So I do this in two steps. First I run a select on the context to bring back the entity with the given id. If that returns null, I create a new entity and…

FeeFiFoFum
- 1,719
- 1
- 11
- 18
2
votes
1 answer
Generate unique contiguous sequence number based on specific criteria without using TABLOCKX
A new entry is inserted in a table called 'Confirmation' each time a message is sent to my clients. During the insertion, I need to get the MAX value of the 'SequenceNumber' column of confirmations sent during the day to my specific client. This…

Shah MOHAMOD
- 23
- 3
2
votes
0 answers
NodeJS framework to properly handle ACID transactions and database concurrency
I am a beginner in NodeJS world coming from several years working with relational databases in Java / Hibernate.
I would like to use Node for a project, and have spent some time researching about frameworks / ORMs that handle proper database…

David Fernandez
- 585
- 1
- 6
- 20
2
votes
1 answer
Concurrency control when read/write SQLServer with EF6 from IIS web request
I am writing a ASP.NET ApiController that is hosted on IIS. In an action I need to invoke a Web Service named A provided by a company named Tencent. The service requires that I use a key to authenticate. The key is generate by calling another web…

Lionet Chen
- 832
- 11
- 26
2
votes
1 answer
DocumentDB unique concurrent insert?
I have a horizontally event-source driven application that runs using an Azure Service Bus Topic and a Service Bus Queue. Some events for building up my domain model's state are received through the topic by all my servers, while the ones on the…

Mathias Lykkegaard Lorenzen
- 15,031
- 23
- 100
- 187
2
votes
1 answer
Multiversion Timestamp-based concurrency control
In timestamp based concurrency control why do you have to reject write in transaction T_i on element x_k if some transaction with T_j where j > i already read it.
As stated in document.
If T_j is not planing to do any update at all why is it…

Egor
- 175
- 8
2
votes
2 answers
Entity Framework and DBContext Issues
I was warned not to use more than one DBEntityContext of the Entity Framework in my application. The reason being the risk of deadlock due to concurrent access to the database.
Can anybody confirm this? If this true is it a good idea to implement a…

CloudyMarble
- 36,908
- 70
- 97
- 130
1
vote
2 answers
Prevent duplicate inserts without using unique keys in Oracle
This is a use case in member enrollment via web application/web service. We have a complex algorithm for checking if a member is duplicate, by looking at multiple tables like phone,address etc. The algorithm varies based on member's country. So this…

Suneel
- 817
- 3
- 10
- 23
1
vote
1 answer
Enforcing maximum number of relations in concurrent requests
I have these entities in my business:
class Team
{
public int Id { get; set; }
public string Name { get; set; }
public List Members { get; set; }
}
class Member
{
public int TeamId { get; set; }
public int UserId { get;…

Daniel Jee
- 664
- 5
- 10
1
vote
0 answers
TableAdapter not updating in-memory values in DataTable
I have a TableAdapter with a designer-built .Update() command. The TableAdapter also has a command which will update just one of the fields in one of the records. This command is .AddBankName.
However .AddBankName appears to be causing .Update() to…

El Ronnoco
- 11,753
- 5
- 38
- 65
1
vote
3 answers
Close Rails ActiveRecord Connection Pool
I am using a second database with datasets within my API.
Every API request can have up to 3 queries on that Database so I am splitting them in three Threads. To keep it Thread safe I am using a connection pool.
But after the whole code is run the…

Miguel Torres
- 51
- 5
1
vote
0 answers
How to allow just one out of two simultaneous popping (SELECT + DELETE) on the same row of data in a database relation?
I am currently developing a backend system that has two endpoints of concern that interacts with a common relational database table. The main purpose of this system is an after-registration email verification system that has a time limit.
Let's…

comtalyst
- 23
- 4