.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to turn off optimistic concurrency checking?

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net

I have run into a problem with optimistic concurrency in my dynamic data application (where all relevant settings are at their default values); when I try to update or delete one of my tables, I see the following error:

 Exception type: ChangeConflictException
 Exception message: Row not found or changed.

I am the only user of my database at the moment, so I can guarantee that the data both exists and has not been changed outside the application!

Various forums have suggested that the way to deal with this is to set the column attributes so that the concurrency checking is disabled; i.e.

[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PropSurname", DbType="NVarChar(255)", UpdateCheck=UpdateCheck.Never)]

However, to do this manually through the Visual Studio designer will take me hours (I have a lot of tables) and if I then change the schema of one of the tables in the DB, won't I then have to do it all again?  I've tried editing the .designer.cs file directly but my changes are subsequently overwritten (as expected).

All suggestions gratefully received!

Ed Graham

View Complete Post

More Related Resource Links

Implementation of Audit Fields and optimistic concurrency

What is the best way to implement Optimistic concurrency? Also, I have 4 audit columns in every table in my database. They are created date, updated date, created by, updated by. Application should populate these fields. I want to know how to populate created date , and updated date? From where application datetime or database datetime? On save button click, if I have to save data into 4 different tables, then I need to have same datetime in all 4 audit fields correct? What is the best way to implement this? What will be the design? Please let me know.  

Optimistic Concurrency with T-SQL

I have a simple update command: UPDATE Cars SET CarName = @CarName, CarReleaseDate = @CarReleaseDate, CarModel = @CarModel WHERE (CarID=@CarID) After reading around i understand this statement could be converted to implement optimistic concurrency. If so how do i convert this code to accept concurrency issues and avoid having rows edited by two users? Thank you

Thread Performance: Resource Contention Concurrency Profiling in Visual Studio 2010


Visual Studio 2010 includes new resource contention profiling features that help detect concurrency contention among threads. We walk through a profiling investigation to demonstrate how you can pinpoint and fix resource contention problems in your code.

Maxim Goldin

MSDN Magazine June 2010

Thread Diagnostics: Performance Tuning with The Concurrency Visualizer in Visual Studio 2010


Understanding performance bottlenecks in multithreaded apps used to require significant instrumentation and analysis by expert developers. The Concurrency Visualizer in Visual Studio 2010 significantly reduces the burden of parallel performance analysis.

Hazim Shafi

MSDN Magazine March 2010

Concurrent Affairs: Four Ways to Use the Concurrency Runtime in Your C++ Projects


This article describes how to integrate the new parallel computing libraries in the Visual Studio 2010 Beta into existing C++ projects. Based on four common scenarios, the column explains a few of the ways developers can use the APIs and classes that are part of the Parallel Pattern Library (PPL), Asynchronous Agents Library, and Concurrency Runtime.

Rick Molloy

MSDN Magazine October 2009

Synchronization Coverage: Code Coverage for Concurrency


As more and more multi-threaded software applications get developed, software development professionals need to adopt new tools, techniques and metrics that can deal with multi-threaded software. Synchronization coverage is a simple, practical way to do this and this article covers a prototype synchronization coverage tool for .NET, called Sync Cover.

Chris Dern, Roy Tan

MSDN Magazine September 2009

The Polyglot Programmer: Concurrency with Channels, Domains and Messages


Axum is not a general-purpose language like C# or VB, but one aimed squarely at the problem of concurrency, designed from the outset to be part of a suite of languages that collectively cooperate to solve a business problem.

Ted Neward

MSDN Magazine September 2009

Concurrency Hazards: Solving 11 Likely Problems In Your Multithreaded Code


Here we describe some of the more common challenges to concurrent programming and present advice for coping with them in your software.

Joe Duffy

MSDN Magazine October 2008

Concurrency: Tools And Techniques to Identify Concurrency Issues


Efficient parallel applications aren't born by merely running an old app on a parallel processor machine. Tuning needs to be done if you're to gain maximum benefit.

Rahul V. Patil and Boby George

MSDN Magazine June 2008

CONCURRENCY: Synchronization Primitives New To Windows Vista


Windows Vista has lots of goodies for native C++ developers including condition variables, slim reader/writer locks, and one-time initialization.

Robert Saccone and Alexander Taskov

MSDN Magazine June 2007

CLR Inside Out: Using concurrency for scalability


Because of the popularity of multiprocessor machines, many concurrency articles focus on how to make concurrency safe in your code. However, they don't deal with how to get concurrency into your code in the first place.

Joe Duffy

MSDN Magazine September 2006

Concurrent Affairs: Concurrency and Coordination Runtime


What can a robot-programming toolkit do for you? Read on and find out.

Jeffrey Richter

MSDN Magazine September 2006

C++ at Work: Web Version Checking, Adding Sound to an App


This month: CWebVersion revisited using HTTP instead of FTP, and adding sounds to an MFC-based app.

Paul DiLascia

MSDN Magazine May 2006

Concurrency: What Every Dev Must Know About Multithreaded Apps


Multithreading offers lots of benefits, but it's not a technique you can employ willy nilly without first learning about all the potential pitfalls. To get you started, Vance Morrison covers multithreading and the shared memory threading model, race conditions and how concurrent access can break invariants. He also discusses how to use locks so you can understand the costs involved.

Vance Morrison

MSDN Magazine August 2005

Data Points: Handling Data Concurrency Using ADO.NET, Part 2


Enterprise development has been moving towards a discon-nected model in recent years and ADO. NET development is no exception. While the disconnected model of the ADO. NET DataSet offers great flexibility, that adaptability also means looser control over data updates than you get with a connected data access model.

John Papa

MSDN Magazine October 2004

Data Points: Handling Data Concurrency Using ADO.NET


One of the key features of the ADO. NET DataSet is that it can be a self-contained and disconnected data store. It can contain the schema and data from several rowsets in DataTable objects as well as information about how to relate the DataTable objects-all in memory.

John Papa

MSDN Magazine September 2004

InfoPath: Turn User Input into XML with Custom Forms Using Office InfoPath 2003


Office InfoPath 2003 is a new Microsoft Office product that lets you design your own data collection forms that, when submitted, turn the user-entered data into XML for any XML-supporting process to use. With an InfoPath solution in place, you can convert all those commonly used paper forms into Microsoft Office-based forms and end the cycle of handwriting and reentering data into your systems. Today organizations are beginning to realize the value of the mountains of data they collect every day, how hard it is to access it, and are striving to mine it effectively. InfoPath will aid in the design of effective data collection systems. Here the author shows you how to get started.

Aaron Skonnard

MSDN Magazine September 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend