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

ASP.NET MVC OptimisticConcurrencyException

I am trying to write to two tables in my database in a function that takes in lists as a parameter from the previous page. I call the db to retrieve the purchase_order_no because the column is an IDENTITY primary key that is generated on entry.…
TaylorM
  • 109
  • 1
  • 11
0
votes
1 answer

Pessimistic vs optimistic concurrency control implementation

I've understood how both these concurrency controls work in plain English. However I was more interested how pessimistic control must be done in code. Here is what I feel, let's assume two users are trying to update a wiki document Pessimistic…
ffff
  • 2,853
  • 1
  • 25
  • 44
0
votes
1 answer

How to check if database row value has changed before doing a fill on a dataset

When I try to update a database with some modified values in a dataset, a concurrence exception doesn't raise if i change manually some values in the database after the fill method on the dataset is performed. (I only get the exception if I delete a…
0
votes
1 answer

How do I get Linq-to-SQL to ignore columns that are modified by INSERT triggers?

There's a column on one of my tables that's being updated by various INSERT/DELETE triggers in my database - the triggers perform some calculation based on the contents of linked tables and store the result in a column on the base table for easier…
Dylan Beattie
  • 53,688
  • 35
  • 128
  • 197
0
votes
0 answers

Optimistic concurrency despite lock

I have multiple threads running a batch job. When each thread finishes it calls this method of mine: private static readonly Object lockVar = new Object(); public void UserIsDone(int batchId, int userId) { //Get the batch…
0
votes
1 answer

RavenDB concurrency, locking documents or the likes?

I'm not 100% sure how to address this problem I have, so I'll try to illustrate my problem first. Please ignore that it's a bad example or a bad design of data structure, because this is simply an example. Imagine we have a class called Person. The…
wpa
  • 220
  • 3
  • 11
0
votes
1 answer

Optimistic locking and overriding

I am getting difficulties when trying to understand how can version-based optimistic locking prevent "last-commit-wins" issue and appropriate overriding. To make the question more concrete, let's consider the following pseudo-code that uses…
0
votes
1 answer

Problems with Optimistic Concurrency through an ObjectDataSource and a GridView

I'm having a problem in an ASP .NET 2.0 Application. I have a GridView displaying data from an ObjectDataSource (connected to a BLL class which connects to a TabledAdapter (Typed Dataset using optimistic concurrency). The select (displaying the…
0
votes
1 answer

SignalR and one browser window for a session at a time

I have a situation where a user can modify an Excel like grid schedule online. I would like to be able to show a message stating that the schedule is being modified in another window. However, how can I do this with a window open, and if the…
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
0
votes
1 answer

Notify user of a change to data through ajax or some other mechanism

I need to try to notify a users who are modifying the same page that an update was made to an Excel grid SPA. I was thinking about passing pack and forth the date modified timestamp and if the original is in the past from the current in the…
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
0
votes
2 answers

Concurrency Violation in NHibernate( c#) example

For quite some time , I was reading about the optimistic concurrency in NHibernate. If what i understood was correct then the below sample should hold good. Consider two transactions T1 and T2. When T1 and T2 are done simultaneously , the state(DB…
0
votes
2 answers

Detecting concurrent calls of a method

I have a class Serializer: class Serializer extends Consumer { final Consumer actual; // constructor omitted for brewity @Override public synchronized void accept(T t) { actual.accept(t); } } The purpose is…
akarnokd
  • 69,132
  • 14
  • 157
  • 192
0
votes
2 answers

inserting using linq-to-entities

Hi I'm having trouble solving this error. Any help on the problem would be much appreciated, thanks! Error message: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted…
0
votes
1 answer

What is the Concurrency Control technique used in Meteor

I am pretty new to Meteor, But I found it interesting. I am just wondering what is the underlying technique or algorithm that Meteor uses to do concurrency control in Real-time and how it works with conflicts? is it based on Operational…
0
votes
1 answer

OptimisticLock Trying update the same object again

I'm getting the below exception: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [ It happens when I try to update an object using a Form again. So in the first…
1 2 3
14
15