Questions tagged [database-concurrency]

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

132 questions
21
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
  • 103,297
  • 39
  • 432
  • 788
18
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…
11
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
  • 543
  • 2
  • 5
  • 15
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
  • 519
  • 3
  • 11
  • 20
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…
mattytommo
  • 52,879
  • 15
  • 115
  • 143
6
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
  • 136
  • 8
5
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
  • 38,221
  • 13
  • 94
  • 174
5
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
  • 6,742
  • 14
  • 45
  • 74
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-
  • 97,629
  • 82
  • 259
  • 398
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,735
  • 4
  • 42
  • 67
4
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.
  • 701
  • 1
  • 6
  • 22
4
votes
1 answer

Django concurrency editing

I'm in a bit of muddle about how and where my concurrency editing functions should be implemented, so that a Mutex concurrency editing cannot be performed. My code: models.py class Order(models.Model): edit_version =…
4
votes
1 answer

Hibernate (JPA): how to handle StaleObjectStateException when several object has been modified and commited

Consider the scenario: A Db transaction envolving more than one row from different tables with versioning. For example: A shopLists and products. Where a shopList may contain products (with their amount in the shoplist) and products have their…
4
votes
1 answer

Modifying Entity Framework Entities from Multiple Threads

I have a UI thread which enables the user to set certain properties of an entity. I also have worker threads which will automatically modify properties of an entity that, importantly, the user does not have access to. Would it be safe to have…
4
votes
1 answer

Single MySql Database Connection for REST service

I am developing Android application which Gets and Posts data to database through REST service. I have configures REST service with Jersey and Tomcat in Java. I created single database connection when REST service starts.Now all the android clients…
Zain
  • 1,116
  • 1
  • 14
  • 26
1
2 3
8 9