Questions tagged [database-concurrency]

Database concurrency is a database property that allows users to access data at the same time.

148 questions
27
votes
2 answers

Does PostgreSQL run some performance optimizations for read-only transactions

According to the reference documentation the READ ONLY transaction flag is useful other than allowing DEFERRABLE transactions? SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; The DEFERRABLE transaction property has no effect unless the …
Vlad Mihalcea
  • 142,745
  • 71
  • 566
  • 911
19
votes
3 answers

Checking Concurrency on an Entity without updating the Row Version

I have a parent entity that I need to do a concurrency check (as annotated as below) [Timestamp] public byte[] RowVersion { get; set; } I have a bunch of client processes that access readonly values out of this parent entity and primarily update…
12
votes
2 answers

What's the best way to manage concurrency in a database access application?

A while ago, I wrote an application used by multiple users to handle trades creation. I haven't done development for some time now, and I can't remember how I managed the concurrency between the users. Thus, I'm seeking some advice in terms of…
Goul
  • 573
  • 2
  • 5
  • 16
11
votes
1 answer

Amazon DynamoDB Conditional Writes and Atomic Counters

The application im working on currently requires me to increment an attribute belonging to an item in DynamoDB many times in a 20 to 30 minute period. I've been doing some additional reading about DynamoDBs conditional writes and atomic…
john
  • 709
  • 3
  • 13
  • 25
11
votes
1 answer

Azure database concurrent usage issues

Just wanted to run this by you all to see if there are any bright ideas as I have exhausted all of my ideas after an entire day, night and morning of searching. The issues we’re encountering invariably centre around database connectivity when under…
Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148
8
votes
1 answer

Transaction lock in MongoDB

I am trying to develop a booking system, that books different assets after checking its availability. The system first tries to read records from the DB and checks if the slot being booked is available. If so, the system books the slot for them by…
sasidhar
  • 7,523
  • 15
  • 49
  • 75
8
votes
1 answer

SQL counter increment concurrency issues - The select/update issue

This is more of a knowledge sharing post. Recently in one of my projects, I came across a issue which is pretty common, but never really gave it a thought till I faced it. There are number of solutions available, but somehow I did not find THE ONE…
Sourav
  • 176
  • 1
  • 9
6
votes
2 answers

Proper RowVersion simulation in SqLite with conversion to ulong on Entity Framework Core

I'm trying to make RowVersion work properly both on SqLite and SqlServer with easy query on the rowversion column. To be able to do that I need to convert the rowversion column to ulong instead of byte[] and still have it work properly. public…
6
votes
5 answers

Atomic locking of all rows of a JDBC batch update

I have two threads running concurrent updates on a table similar to: CREATE TABLE T ( SEQ NUMBER(10) PRIMARY KEY, VAL1 VARCHAR2(10), VAL2 VARCHAR2(10) ) The table is containing a large number of entries where the updates are similar…
Rafael Winterhalter
  • 42,759
  • 13
  • 108
  • 192
6
votes
2 answers

How are SQL Server Intent-locks work?

I have read some articles regarding intent lock that there are plenty of intent locks which are Intent shared (IS), Intent exclusive (IX), Shared with intent exclusive (SIX), Intent update (IU), Shared intent update (SIU), Update intent exclusive…
Alfin E. R.
  • 741
  • 1
  • 7
  • 24
5
votes
2 answers

Is there a possible race condition in this UPDATE statement?

I'm writing a synchronizer software which will take all changes in one DB and synchronize them to another DB. To this end I've added in my table T two columns: alter table T add LastUpdate rowversion, LastSync binary(8) not null default 0 Now I can…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
5
votes
1 answer

How to handle concurrent requests that delete and create the same rows?

I have a table that looks like the following: game_stats table: id | game_id | player_id | stats | (many other cols...) ---------------------- 1 | 'game_abc' | 8 | 'R R A B S' | ... 2 | 'game_abc' | 9 | 'S B A S' | ... A user uploads data for a…
you786
  • 3,659
  • 5
  • 48
  • 74
4
votes
0 answers

How to do stock reduction for a list of items in shopping cart using distributed lock and SQL transaction to ensure consistency

Question: I wrote a Sell() function which do stock reduction for a list goods in user's shopping cart. Assume there will be thousands of request within a second for those goods. Since we need to improve the throughput and make sure the service is…
W.W.G
  • 93
  • 2
  • 6
4
votes
0 answers

Automatic database update with DbUp in multi application environment

I have multiple desktop apps that can run DbUp at startup. And how to handle this situation if couple apps run DbUp at the same time? I have to have automatic solution for that because there are plenty clients and DB update cannot be run by the DBA.…
Viktorasd
  • 41
  • 3
4
votes
1 answer

Creating atomic function in nodejs

The title isn't accurate because based on what I have found in my research there doesn't seem to be a way to make a function atomic in nodejs, but I will lay out my problem to see if you people can come up with something that I have not been able to…
Ameya Savale
  • 431
  • 1
  • 8
  • 21
1
2 3
9 10