Questions tagged [database-concurrency]

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

148 questions
1
vote
0 answers

Debugging database connection leak in concurrent environment

I'm currently working on a project which was originally not build for high load. My problem atm is that at some point during the stress test (30 users) the application seems to "get stuck" and when it releases it spits out a lot of exceptions.…
1
vote
2 answers

how to insert data into multiple relational tables by using multiple tasks

first off, i am new to programming. i am trying making a program that uses many tasks. These tasks will insert data into multiple relational tables. (i am using sql server) But, i think it is possible that there might be concurrency issues like,…
cinfis
  • 345
  • 4
  • 14
1
vote
1 answer

GAE pessimistic locking on CloudSQL

Has anyone tried to implement pessimistic locking on GAE? On my project there are some tasks that have to be mutually exclusive. I have done this by using: javax.persistence.EntityManager.find(entityClass, primaryKey,…
1
vote
1 answer

Getting "Invalid cursor state (0)" when running concurrent requests (SQLAlchemy & wsgi/python)

I'm using SQLAlchemy in WSGI python web app to query the database. If I do two concurrent requests, the second request invariably throws an exception, with SQL Server stating [24000] [FreeTDS][SQL Server]Invalid cursor state (0)…
Jordan Reiter
  • 20,467
  • 11
  • 95
  • 161
1
vote
1 answer

Mysql - stored procedure concurrency concern

I have a stored procedure that selects from a table A values it then uses to select from table B. If the number of rows is less than a threshold, it updates Table A's values and reselects table B. Select val into v from A; Select ID from B where…
vbbartlett
  • 179
  • 2
  • 14
1
vote
0 answers

How to enable read committed snapshot only

I'd like to use READ COMMITTED SNAPSHOT in a SQL Server database, which I understand is different from SNAPSHOT ISOLATION. I want to enable READ COMMITTED SNAPSHOT because I'm having problems with deadlocks. I'm using EF and I think this will…
1
vote
1 answer

Entity Framework to Auto Increment Non Identity Column / Concurrency Issue

I have two tables: CREATE TABLE [dbo].[Customers] ( [CustomerId] INT IDENTITY (1, 1) NOT NULL, CONSTRAINT [PK_dbo.Customers] PRIMARY KEY CLUSTERED ([CustomerId] ASC) ); CREATE TABLE [dbo].[Campaigns] ( [Id] INT …
1
vote
1 answer

managing concurrency using update queries where condition

I am using mysql, php. table user_meetup id, user_id, meetup_id with unique on (user_id, meetup_id) if my meetup is limited by places(10 places) 9 users already marked rsvp and if 2 users doing RSVP at the same time (i just have consider a case of…
1
vote
0 answers

Concurrent SELECT and DELETE

I have two transactions. One that assign tags to post after it's creation (Transaction B). Another transaction (Transaction A) deletes tags which are no longer used by any post. It's being done after post deletion. Transaction A SELECT COUNT(*) FROM…
Ivan Virabyan
  • 1,666
  • 2
  • 19
  • 25
1
vote
1 answer

Concurrency control in a shared database

Suppose i have a database that is shared by multiple application.One Application uses ORM based approach(say hibernate) for persistence and another application uses sql for persistence.Both do write operations on the database. How can we ensure…
binu
  • 23
  • 2
1
vote
1 answer

SQL 2005 sp_GetAppLock --- When to call sp_ReleaseAppLock?

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED BEGIN TRAN DECLARE @res INT EXEC @res = sp_getapplock @Resource = 'This a Lock ID 3', @LockMode = 'Exclusive', @LockOwner = 'Transaction', @LockTimeout = 60000, @DbPrincipal = 'public' if…
Clint
1
vote
1 answer

Handling concurrency in spring mvc (hibernate)

I find it hard to believe that I am the only one wondering about the proper way to implement this but unfortunately my search didn't return any good solution. Basically we have web apps implemented using spring mvc and hibernate. Since it is a MVC…
1
vote
0 answers

MySQL & concurrent updates showing for users in simultaneous connections w/o disconnect

We have a MySQL database managed through phpmyadmin. One of my coworkers is insisting that the database will not parse updates to the DB until all simultaneous connections are closed. I think he is saying that if we have 20 users connected to the…
0
votes
1 answer

Apache Camel - Routing messages to JPA endpoint - keeping orders but splitting into pools based on a category header

We have simple project which takes a number of messages from a number of endpoints(agents). These agents all output the same format message (an entity object to be placed in a database). All the agents write to the one queue and we consume these and…
NightWolf
  • 7,694
  • 9
  • 74
  • 121
0
votes
1 answer

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 catch a "DbConcurrencyException" if there is a value? Ex.…