154 questions
0
votes
1
answer
48
views
Can I remove the pg_try_advisory_lock() call for function run_maintenance_proc() generated by pg_partman extension?
Why does the PostgreSQL run_maintenance_proc need pg_try_advisory_lock? Can I remove that? It keeps creating table deadlocks.
Its probably because I am also using dbt to generate a few materialized ...
0
votes
0
answers
34
views
How should one prevent a DDB item being deleted unless there are no items left which reference it?
Let's say I have 2 types of item in my DDB table: Trains and Passengers. They look like this:
{
"type": "train",
"id": "OrientExpress" // partition key
}
{
...
0
votes
0
answers
31
views
What is the relationship between conflict serializable schedule and the serializable isolation level
So if a schedule is conflict-serializable, then it is conflict-equivalent to a serial schedule, which should have no anomalies since serial schedules have no anomalies.
If your DBMS runs transactions ...
0
votes
1
answer
51
views
Db Concurrency issue with post likes
I have a like method, the method should add users likes records to a post, and also add the like count, this a commom issue for concurrency. what is actually bothering me is the maxRetryAttempts = 50, ...
0
votes
1
answer
1k
views
Npgsql EF Core concurrency token property gets included in migrations
I have a case where I would like to add a concurrency token handling in my EntityFrameworkCore 8+ application. I have an entity named User (stripped down for simplicity purposes) to which I added a ...
0
votes
1
answer
315
views
How would I create a concurrency token check on multiple columns in my DB table in EF Core?
I have to charge my users a monthly fee and want to make sure I don't charge them twice.
I created a table called PlatformFee that looks like this to check to see if I've charged them. If there's any ...
0
votes
2
answers
874
views
Concurrency violation: the UpdateCommand affected 0 of the expected 1 records, Error occurs for few tables in DB but not for all tables
I am using VB.Net with MS Access for Database (Local DB)
I am using Databound Controls and strongly typed Dataset generated through Wizard.
My App is Single User / Single Instance Application so no ...
1
vote
1
answer
213
views
Concurrency problem with Redis in Node.js
Problem
I have a key called stocks in my Redis and its value is 1000. Suppose 300 customers request to buy (100 stocks each) at the same time. In the end, only 10 customers should be able to buy.
...
1
vote
2
answers
162
views
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<Member> Members { get; set; }
}
class Member
{
public ...
0
votes
1
answer
261
views
How can I prevent a second user from overwriting an entity property(column) in EF Core?
If I have an entity called "Lesson" and it has an InstructorId as one of it's fields(columns) and I only want 1 instructor being able to register, do I need to create a concurrency token and ...
0
votes
0
answers
107
views
Concurrency control for table generated Transaction Id
I have a system in which I generate the transaction ids based on a table. The number must have a specific format therefore using database sequences is not an option. Moreover, the number transactions ...
-1
votes
1
answer
90
views
How to avoid the concurrent problem in back-end when select-then-update from MySQL [duplicate]
I'm using Java and MySQL. And I have a table:
create table serial_number (
id int not null primary key auto_increment, -- PK
sn int, -- The serial number
available tinyint -- 0: ...
1
vote
3
answers
1k
views
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 ...
0
votes
2
answers
104
views
While the server is under more strain, queries become slower
How can I improve the following query's performance while the server is loaded? I've created a combo index and removed the index from the table because it's not picking it up, but is there another way ...
0
votes
1
answer
544
views
Conditionally preventing inserts from other concurrent transactions until the specific transaction finishes
I'm currently using Postgres 14 and have a problem related to concurrency control.
Let's say we have 2 transactions. Transaction A and transaction B. Transaction A acquires exclusive locks on multiple ...