Database concurrency is a database property that allows users to access data at the same time.
Questions tagged [database-concurrency]
148 questions
1
vote
2 answers
Get unique row (at the moment)
I have a high traffic PHP site (lots of concurrent visitors) that uses MySQL for persistence. The site can be used to purchase various gift cards.
The controller in PHP handles purchases like this:
Step 1
SELECT id, reference_number, card_number…

Ahmed Fawky
- 19
- 3
1
vote
1 answer
Why the SQLite database file is locked using WAL Mode and Pooling enabled?
I am using a SQLite Database in my C# program.
The program saves values every second in the DB, and also checks everytime if the tables already exist:
class DataManager : IDataManager
{
private bool machineTableIsCreated = false;
private…

Vini121
- 41
- 9
1
vote
3 answers
Blazor Parent and child OnInitializedAsync accessing DB context at same time
Both parent and child have to access db context in order to get their specific data, bellow is their code.
Parent:
[Inject]
private IProductsService ProductService { get; set; }
private IEnumerable ProdList;
private bool…

MarchalPT
- 1,268
- 9
- 28
1
vote
1 answer
Mysql and execute stored procedure in atomic way or select update atomically
In Mysql I have two concurrent processes that need to read some rows and update a flag based on a condition.
I have to write a stored procedure with transaction but the problem is that sometimes the two processes updates the same rows.
I have a…

Tom
- 4,007
- 24
- 69
- 105
1
vote
2 answers
Deadlocks and Timeouts break ACID transactions
I've got transactional application that works like so:
try {
$db->begin();
increaseNumber();
$db->commit();
} catch(Exception $e) {
$db->rollback();
}
And then inside the increaseNumber() I'll have a query like so, which is the…

creamcheese
- 2,524
- 3
- 29
- 55
1
vote
1 answer
The mechanism how the database concurrency works
Could some body explain me how the database concurrency works? I am using HSQLDB.
For example, if there are two different users to insert a record at the same time from two different entry points, how does the database handle this? Are these two…

NARU
- 2,769
- 5
- 23
- 28
1
vote
1 answer
Handling multiple users concurrently populating a PostgreSQL database
I'm currently trying to build a web app that would allow many users to query an external API (I cannot retrieve all the data served by this API at regular intervals to populate my PostgreSQL database for various reasons). I've read several thing…

Lo Bellin
- 485
- 4
- 20
1
vote
1 answer
Core data Crash: EXC_BAD_ACCESS while trying access data got using predicate
I have save values to entity method which save new data and updates existing data.
func saveSteps(_ serverJson: [[String: Any]]){
let stepService = StepService(context: context);
if(serverJson.count > 0){
for step in serverJson {
…

Santhosh S Kashyap
- 973
- 2
- 13
- 19
1
vote
0 answers
Postgresql failing one transaction out of multiple concurrent transaction only on specific commit ordering
I play around with Postgres serializable mode, and found some commit order that fail a transaction, but wont fail a transaction in case of different commit ordering.
For below code, I run from each transaction concurrently, but do operation on each…

aaron
- 257
- 6
- 15
1
vote
2 answers
Concurrent saves using JpaRepository
I'm working on a microservice that serves REST endpoints for saving/retrieving data to/from a database, using spring data.
Lets call the entity class Foo which has a simple Long for its ID field some other data fields. IDs for each Foo are not…

Ben Faucher
- 11
- 1
- 4
1
vote
1 answer
Which explicit lock to use for a trigger?
I am trying to understand which type of a lock to use for a trigger function.
Simplified function:
CREATE OR REPLACE FUNCTION max_count() RETURNS TRIGGER AS
$$
DECLARE
max_row INTEGER := 6;
association_count INTEGER := 0;
…

Andrey Deineko
- 51,333
- 10
- 112
- 145
1
vote
2 answers
MySQL query synchronization/locking question
I have a quick question that I can't seem to find online, not sure I'm using the right wording or not.
Do MySql database automatically synchronize queries or coming in at around the same time? For example, if I send a query to insert something to a…

Jeb
- 33
- 6
1
vote
1 answer
How database locks and web server collaborate with respect to database sessions?
This question has a wide area set, e.g. web servers, database servers, php application, etc and hence I doubt it belongs refers to stackoverflow, however since this question will help us on how to write the application code, I have decided to ask it…

Musa Haidari
- 2,109
- 5
- 30
- 53
1
vote
1 answer
PostgreSQL maximum connections based on api call or single app to db connection?
I'm using ElephantSQL's tiny turtle plan (5 concurrent connections). By "concurrent connections" does this mean when the application opens the connection (I'm using Gorm so gorm.Open()) on app startup, or does it mean on a per-query-basis?
I've…

Greg Miller
- 1,064
- 13
- 22
1
vote
0 answers
View Serializability
If a schedule of transactions is not view-serialisable, can we conclude that the schedule is non-serialisable?
In other words, is it possible for a schedule to be serialisable and yet not view serialisable?
If possible, please give an example.

vishalgoel
- 69
- 4