Questions tagged [database-concurrency]

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

148 questions
1
vote
4 answers

How to achieve maximum concurrency for a distributed application using a database as medium of communication

I have an application which is similar to classic producer consumer problem. Just wanted to check out all the possible implementations to achieve it. The problem is- Process A: inserts a row into the table in database (producers) Process B: reads M…
1
vote
1 answer

Limiting resources allocated to a slow MySQL Query

I have a process that needs to run every X minutes to update certain information. It does not matter whether the query takes 10 seconds, 20 seconds or even a minute. What matters though, is that the information is updated at least every 10 minutes…
1
vote
1 answer

How to store git branch like data structure in postgresql?

I'm trying to build a wikipedia like thing, where multiple people can edit the content。People with privilege can also revert changes. I don't want reversions to be lossy (meaning really drop the edits people made. It should only hides it), so this…
hgl
  • 2,034
  • 4
  • 21
  • 30
1
vote
2 answers

Highload web projects using SQL databases

I want to ask a question about approaches in highload web applications development using SQL databases. Assume we have simple CMS system providing access to different articles. Also we want to store article visits quantity in database. This visits…
1
vote
1 answer

Linq-to-Sql Read-Test-Write as one operation

I have Tasks table: Id (PK), TaskName, Status Status is one of: Queued, Busy, Complete. I want to use multiple threads to process the tasks, and for that I need to be able to do in one operation: var task = db.Tasks.FirstOrDefault(t=>t.Status ==…
THX-1138
  • 21,316
  • 26
  • 96
  • 160
1
vote
1 answer

MySQL: Deadlock in a single table UPDATE...WHERE

The next issue raises with this configuration: MySQL 5.7.10 Spring 4.0.5 Spring Batch 3.0.1 Spring ThreadPoolTaskExecutor between 10 and 20 threads The issue is a deadlock when some threads try to do an UPDATE...WHERE in a single table. The…
1
vote
1 answer

Concurrent database MVCC timestamp generation method

I need to generate database timestamps for MVCC Snapshot isolation. The typical method utilized: "Transactional actions are implemented in SI-TM as follows. TM BEGIN: A logical snapshot for the transaction is generated by obtaining a unique…
1
vote
0 answers

Insertion in innodb and update in myisam in Mysql database getting too slow

I have recently done following changes in my sql server configurations thread_cache_size=100 key_buffer_size=1G …
1
vote
2 answers

Grails "Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect)"

There doesn't appear to be definite solution to concurrency problems in Grails (2.3.7). I've tried all the recommendations, but when I push the number of concurrent threads, the following piece of code invariably fails: package simpledb import…
1
vote
1 answer

DynamoDb safe update

I am trying to update a counter in my simple database (one key, one numeric value). Atomic counters seem the natural solutions, but I need thread safe updates, i.e. I need to make sure that updates do not interfere with each other. This answer seem…
1
vote
2 answers

How to prevent race conditions in a web application

I have a web application where user register by clicking a button "Join". There can be so many users on the website and that is why in order to keep my database queries fast; I chose not to have foriegnkey constraint added in database(Though it is…
1
vote
0 answers

SQL: Trying to understand how to use safely access and modify database concurrently

So, I'm working in MySQL at the moment, but any SQL answers will probably do, cuz I'm trying to understand the general concepts. So thread safety is obviously important in concurrent environments. I program primarily in Java and I'm always extremely…
craigmiller160
  • 5,751
  • 9
  • 41
  • 75
1
vote
1 answer

Django database concurrency problems

I´ve got a "single" method within a web api that makes two database calls Ensure with count() an specific objects does not exists Save the object if it doesn´t exists already The logic here is obviously not saving an object if it exists already.…
xleon
  • 6,201
  • 3
  • 36
  • 52
1
vote
1 answer

How does BaseX handle concurrency?

I'm looking at using BaseX as a more flexible database. How does it handle database concurrency? How does it work in a web app scenario, where two different users could update the same data and effectively get a "dirty read"?
Martin Thompson
  • 3,415
  • 10
  • 38
  • 62
1
vote
0 answers

Is it dangerous when plenty of users need one and the same table (simultaneous access for a table) in a Database?

I use the code of a server which serves each user by putting some personal data into a DB table. There are plenty of users and two of them for instance would like to put some data in the table in a DB. How will sql server perform in this case? Are…
Dzi Lean
  • 89
  • 6