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
5
votes
1 answer

Using Microsoft.WindowsAzure.StorageClient.TableServicesContext and detecting concurrency update conflicts

The problem is that some classes (DataServiceClientException / DataServiceRequestException / DataServiceResponse) exist in both System.Data.Services.Client.dll and Microsoft.Data.Services.Client.dll. The simple approach would be to use only one of…
Joshcodes
  • 8,513
  • 5
  • 40
  • 47
5
votes
1 answer

EF Concurrency Handling with Timestamp attribute in Model First approach

I am trying to implement the solution given in Handling Concurrency with the Entity Framework in an ASP.NET MVC Application . The article says: Adding a Tracking Property to the Department Entity In Models\Department.cs, add a tracking…
escist
  • 763
  • 4
  • 13
  • 35
4
votes
1 answer

Handle concurrency in Entity Framework

I am looking for the best way to handle concurrency while using Entity Framework. The simplest and most recommended (also on stack) solution is described here: http://msdn.microsoft.com/en-us/library/bb399228.aspx And it looks like: try { // Try…
4
votes
1 answer

optimistic concurrency with timestamp and typed dataset in asp.net

i'm creating a forum system for my web site with the use of c# and asp.net and for data access i'm using a typed dataset and for UI i'm using mvp pattern. in my database i have stored procedures which i have been added to my dataset. the problem was…
jim
  • 494
  • 2
  • 5
  • 23
4
votes
3 answers

Concurrency when deleting object in Entity Framework

I'm developing a web app using the entity framework. I load a list of objects and bind it to a repeater to show a summary of all the items. The user may click an edit icon or a delete icon for each item in the repeater. Example: Item 1 | Edit |…
4
votes
4 answers

I don't understand how can optimistic concurrency be implemented in C++11

I'm trying to implement a protected variable that does not use locks in C++11. I have read a little about optimistic concurrency, but I can't understand how can it be implemented neither in C++ nor in any language. The way I'm trying to implement…
Dan
  • 2,452
  • 20
  • 45
4
votes
3 answers

ProstgreSQL, MySQL optimistic concurrency

I have a web application in which data can be changed concurrently by the users. At the moment I include the old row values in each form and update the row only if the data is the same. With SQLite this to be the only option. This is ugly and I…
user141335
4
votes
2 answers

How I can avoid optimistic concurrency exception when I delete rows?

I have a method that receive the IDs of some rows to delete. I am using a code like this: public bool delete(IEnumerable paramIeId) { using(myContext) { foreach(long iterator in paramIeId) { …
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
4
votes
1 answer

How to throttle current jobs in airflow?

I am a newbie to Airflow. But I am now working on how to throttle current jobs in Airflow. Is there someone that knows a little about concurrency or throttling in Airflow. Any suggestions could be helpful. Thanks a lot.
4
votes
1 answer

How to handle org.eclipse.persistence.exceptions.OptimisticLockExceptio

I want to handle concurrent execution by using Optimistic Locking. I have included @Version annotation in my entity class. In my code I am running two threads concurrently. Sometimes it is executing correctly. Sometimes it is throwing…
4
votes
1 answer

Optimistic locking with redis using GET and INCR

I want to "lock" a block of code optimistically. psuedo code is as follows: revision = GET('lock_key') # default as 0 { <> } new_revision = INCR('lock_key') if new_revision != revision + 1: raise Exception # now retry or…
lazy functor
  • 2,118
  • 2
  • 15
  • 16
4
votes
1 answer

Azure Table Storage Concurrency Issue

It seems like concurrency conflicts with Azure throw an exception with a message containing the error code 412. Is there a good way to tell that an exception is thrown due to a concurrency problem other than checking if the error message of a…
Teeknow
  • 1,015
  • 2
  • 17
  • 39
4
votes
1 answer

Entity Framework, PostgreSQL, Optimistic Concurrency with hidden xmin column

I'm working with Entity Framework (Model First approach) against a PostgreSQL 9.1 database. You probably all know that every table has a hidden column called xmin that I would use to help EF determine if the row has changed before performing an…
anon
4
votes
3 answers

Empty Dictionary Error on Delete with SqlDataSource - ASP.net ListView

I'm trying to make a simple ListView with optimistic concurrency. It uses the VS-automatically-generated Delete, Insert, Update statements (except 1 change to insert: see code). Insert and Edit work fine and commit to the database. When trying to…
3
votes
1 answer

Using NHibernate (and Fluent NH) to map datetime-type version columns with better than second accuracy (and not truncate milliseconds)

I have a table with a datetime-type column as the version. It's a legacy DB so I can't possibly change it to datetime2 or use a different versioning mechanism. The NHibernate class is mapping this to a DateTime c# typed property. I've seen several…
1 2
3
14 15