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
2
votes
0 answers

Is there a Web Service (WS) Standard for Optimistic Locking?

Is there a Web Service Standard (WS*) for Optimistic Locking / Optimistic Concurrency Control (OCC) designed for interoperability? There are a number of standards related to pessimistic concurrency control mechanisms, such as WS-AtomicTransaction,…
2
votes
3 answers

RavenDB Catch 22 - Optimistic Concurrency AND Seeing Changes from Other Clients

With RavenDB, creating an IDocumentSession upon app start-up (and never closing it until the app is closed), allows me to use optimistic concurrency by doing this: public class GenericData : DataAccessLayerBase, IGenericData { public void…
Bob Horn
  • 33,387
  • 34
  • 113
  • 219
2
votes
2 answers

RavenDB UseOptimisticConcurrency in Config?

Is there a way to set optimistic concurrency to true in Raven.Server.exe.config? Or, can it somehow be applied at the database level? On RavenDB's site, I see a couple of mentions of setting UseOptimisticConcurrency = true, but it looks like it's at…
Bob Horn
  • 33,387
  • 34
  • 113
  • 219
2
votes
3 answers

Dataset optimistic concurrency

What would I need to do in my dataset C# client for handling optimistic concurrency? This article does not go into many details except from use a timestamp
Damian
  • 4,395
  • 4
  • 39
  • 67
2
votes
2 answers

Handling concurrency condition in entity framework core to prevent race condition

I am trying to run a test case and trying to pass two schedules inside like below: var itemToAdd = new ScheduleInputItemDto { Start = DateTime.UtcNow, End = DateTime.UtcNow.AddHours(1), ProdType = "Prod1" }; var…
2
votes
1 answer

Optimistic concurrency - Isn't there a problem?

I've read the article. The article describes the next solution to situations when many users can write to the same DB. You as a user need to: Retrieve the row and the last modified dateTime of the row. Make the calculations you want, but don't…
2
votes
1 answer

Difference between version=1&version_type=external and if_seq_no=0&if_primary_term=1

Based on this answer, it's clearly to say: version is a sequential number that counts the number of time a document was updated; _seq_no is a sequential number that counts the number of operations that happened on the index, which is used with…
Hearen
  • 7,420
  • 4
  • 53
  • 63
2
votes
1 answer

mongoDB optimistic concurrency control for update

I am simulating multiple concurrent request for MongoDB`s "update". Here is the thing, I insert a data amount=1000 in mongoDB, and every time I trigger the api, it will update the amount by amount += 50 and save it back to database. Basically it is…
Llewellyn
  • 21
  • 1
  • 3
2
votes
0 answers

Is there a way to dispatch actions synchronously with redux-observable?

Description: I'm trying to solve a problem of handling optimistic locking or concurrent editing, via communication between the back-end and front-end. Current implementation: When the front-end makes a request, it includes a specific header of an…
2
votes
0 answers

Adding children in parallel in a ManyToMany Parent-Child relationship with optimistic locking

When using Optimistic Locking with Hibernate; is it possible to allow adding of children in a ManyToMany parent child relationship without increasing the version number of the parent without using @OptimisticLock(excluded = true) on the parents…
Attila
  • 3,206
  • 2
  • 31
  • 44
2
votes
0 answers

Who should update the concurrency token in EF Core?

Who should update the concurrency token in EF Core? I am learning the EF Core through the tutorials over here. And I come across the concept of the concurrency tokens. While it is clear that the row version`s value is updated by the database when…
2
votes
1 answer

Can't Catch DbUpdateConcurrencyException

I'm trying Catch DbUpdateConcurrencyException When I debuging, I got entity.RowVersion is not same with productEdit.RowVersion. But I don't know why this program keep success to save the data. public async Task Patch(Guid id,…
2
votes
1 answer

Does Azure Search Provides Etags for managing concurrency for Add, Update or Delete Documents?

How to manage concurrency in Azure Search here it is said that Azure Search offers an optimistic concurrency model. There are no locks on a resource. Instead, there is an ETag for every resource that identifies the resource version so that you can…
Nafis Islam
  • 1,483
  • 1
  • 14
  • 34
2
votes
0 answers

Will optimistic locking work for following code using updated_at attribute in update_all?

Product model Can be updated by multiple users. However, at a time only one user should able to update. For that, I want to use optimistic locking for Product model using updated_at. I have implemented the following code for the optimistic lock.…
2
votes
1 answer

Entity Framework: RowVersion value is null

I am using Entity Framework 6.2.0 and a local MSSQL (MDF) database. I have several types that all descend from my main type "Entity" ("Table per Type" strategy is used). Now, I am trying to implement optimistic locking. In my EDMX file, I added a…