Questions tagged [optimistic-concurrency]

A concurrency control method applied to transactional systems that allows multiple transactions to frequently complete for resources without interfering with each other

A concurrency control method applied to transactional systems such as relational database management systems and software transactional memory. OCC assumes that multiple transactions can frequently complete without interfering with each other. While running, transactions use data resources without acquiring locks on those resources. Before committing, each transaction verifies that no other transaction has modified the data it has read.

Optimistic concurrency is generally used in environments with a low contention for data. Optimistic concurrency improves performance because no locking of records is required, and locking of records requires additional server resources. Also, in order to maintain record locks, a persistent connection to the database server is required.

http://en.wikipedia.org/wiki/Optimistic_concurrency_control
http://msdn.microsoft.com/en-us/library/aa0416cz%28v=vs.110%29.aspx

224 questions
1
vote
1 answer

entity framework and some general doubts with the optimistic concurrency exception

I have some doubts about optimistic concurrency exception. Well, For example, I retrieve some data from the database, I modify some registers and then submit the changes. If someone update the information of the registers between my request and my…
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
1
vote
1 answer

Convert view to tables and savechanges gives me optimistic concurrency exception

I am working with Entity Framework 4 (using self-tracking entities), and accessing a view, that is the merge of two tables. So when I update the information of the view, I send the STE of the view to the repository which access to the database. I…
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
0
votes
1 answer

MySql with MVC3 gives an error when calling context.savechanges

I'm trying to get my MVC3 application to use MySql database instead of Sql Server 2008. I have created the associated database and objects in Mysql. And Updated the connection string in my web.config file to reference MySql.Data.MySqlClient. …
SimpleUser
  • 1,341
  • 2
  • 16
  • 36
0
votes
2 answers

How do you solve concurrency issues when horizontally scaling microservices that are sharing a DB?

Let's assume that you are running two instances of a Tickets Service sharing a MongoDB database. We receive two updates on the same ticket from a client that will be handled concurrently by the Tickets Service instances thanks to load balancing. For…
Antonio Santoro
  • 827
  • 1
  • 11
  • 29
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.…
0
votes
0 answers

Handling DbUpdateConcurrencyException with SaveChangesInterceptors

Does anyone have an idea if it is possible to implement the retry pattern with SaveChangesInterceptor interceptor? Here is the SavingChangesAsync method. public override async ValueTask>…
0
votes
2 answers

ElasticSearch document is getting updated even after IfSeqNo and IfPrimaryTerm values don't match with assigned sequence number and primary term

I am attempting to verify whether an Elastic search document is being updated correctly by using an index request that has a different sequence number and primary term than what was assigned to the document. According to the documentation if IfSeqNo…
Vikrant Singh
  • 669
  • 1
  • 6
  • 18
0
votes
0 answers

create-two-separate-transactions-in-jpa-within-one-method-call spring boot jpa

Hi I have issues with Transactions.. within single method delete record by Id and then update same record by Id tried with single transaction and multiple transactions but not working .. please suggests me how to handle within Single Transaction…
0
votes
0 answers

SQL Server READ_COMMITTED_SNAPSHOT Isolation Level - Shared Lock Issue

In microsoft documentation about transaction isolation level it states that; If READ_COMMITTED_SNAPSHOT is set to OFF (the default on SQL Server), the Database Engine uses shared locks to prevent other transactions from modifying rows while the…
0
votes
0 answers

Google API support for conditional HTTP requests (If-Modified, etc)

I'm having a hard time tracking down whether the latest Google Sheets and Google Drive APIs support conditional HTTP requests. I'd like to only apply updates to resources if the resource's state matches the expected state, otherwise I need to pull…
0
votes
0 answers

Mongoose - achieve optimistic concurrency with (bulk) update calls

With the newest mongoose version, it's simple to just enable the optimistic concurrency (OCC) via options in the schema like so { optimisticConcurrency: true } But as far as I understood, this will only cause an error to be thrown for parallel…
phoebus
  • 1,280
  • 1
  • 16
  • 36
0
votes
0 answers

Spring Boot and REST API ETag specifications

I have to deal with a concurrency problem for a REST API. i discovered that ETag can help to handle not only concurrency problems but many other behaviors like cache, bandwidth ... It s exactly what i need. But, after having a deep look to Spring i…
0
votes
1 answer

Optimistic concurrency while in transaction

In trying to fix data errors due to concurrency conflicts I realized I'm not completely sure how optimistic concurrency works in SQL Server. Assume READ_COMMITTED isolation level. A similar example: BEGIN TRAN SELECT * INTO #rows FROM SourceTable s…
Max
  • 39
  • 1
  • 4
0
votes
1 answer

Race condition with webhooks when updating a Stripe Connect account and my db, that cannot be resolved with concurrency exception

Scenario - I'm updating a Stripe Connect(bank) account, that has a payout status of disabled, by providing it with an additional identifying document for verification. This will enable the payout status, so that the user can receive payouts. When…
chuckd
  • 13,460
  • 29
  • 152
  • 331
0
votes
1 answer

EventStore expectedVersionException but event was stored

We use EventStore 5.0.0 and we faced with the following situation: when we store event, sometimes, C# client receives response with error. Error from log: EventStore.ClientAPI.Exceptions.WrongExpectedVersionException: Append failed due to…
Maxim Kitsenko
  • 2,042
  • 1
  • 20
  • 43