Home > Ask the Microsoft .Net Development Experts > Visual Studio .NET Questions & Answers > Is ADO.NET record locking no longer an option?
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

Is ADO.NET record locking no longer an option?

Chris Sells EXPERT RESPONSE FROM: Chris Sells

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 13 January 2003
I took an introduction course for VB.NET, in which it was explained that it is impossible to create a program that uses a multi-user style database, since in ADO.NET record locking is no longer an option. This means that when one user retrieves data from the database, and in the mean time someone else accesses and changes the database, this first user cannot save without losing his changes to the records affected by the other.

Is it true that this is impossible? Is there a workaround? How can several users work with data on a network? Thank you very much for your time.


>
Whenever you hear the word "impossible" used to describe anything in software, you should be suspicious. Remember that software is an imaginary world where all things are possible given enough knowledge, time and effort.

In this particular case, ADO.NET has been made to be disconnected and that's a good thing, because that spreads the load to clients, leaving servers to scale better. Because of this, the default behavior in ADO.NET is to not lock the rows being retrieved for a client. Instead, when updating a table, the generated update statements check to make sure that the data hasn't changed while they've been edited by the user. All of this is goodness because if gives you scalability on the server -- i.e. no clients are waiting to retrieved locked rows, while still letting you inform the user that the data has been changed out from under them so that they can take steps to correct things.

However, the scalability and reliability do add some complexity. In fact, because this particular problem has so many solutions based on your application's needs that author Shawn Wildermuth dedicated an entire chapter to possible ways to handle this requirement. Since you should be reading Pragmatic ADO.NET anyway, I don't hesitate in recommending chapter eight Updating the Database for a thorough discussion of these issues.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Ask the Expert
Read data from parallel port
Escape from mailto:
In C#, how can I change the properties of controls on another form?
How do I add images in listview by using VB.NET?
What is the best technique for connecting to a database from VB.NET?
How do you use control collection in VB.NET?
How do I print a form in VB.NET?
How do I get my start page back?
Using an array, how can I create a combo box that lists a dropdown menu for units of length?
How do I determine the type of a control on a Windows Form in VB.NET?

Visual Studio .NET (Archive)
What could be causing this problem with my add New and delete methods?
Is there a .NET equivalent to netsend that I can use in VB.NET?
I'm getting a lot of flickering on my application
How can I make a VB6 network app available on the Internet using .NET?
How can I implement an FTP upload using VB.NET?
VB.NET app works on my local drive but not on the network drive
Is developing add-ons for Windows Explorer supported using managed code in .NET?
In C#, how can I change the properties of controls on another form?
How do I add images in listview by using VB.NET?
What is the best technique for connecting to a database from VB.NET?

Visual Studio .NET
Load a DSL domain model instance file programmatically
Calling via command prompt from ASP.NET
On line-by-line analysis in VS .NET
Best approach for merging text files using arrays
Descriptions of symbols in the class view of a .NET solution
What's the best approach for enumerating network resources?
How to enable a line-by-line code walkthrough
Changing a C++ Makefile project to a Utility project
How can I configure Visual Studio.NET 2002 to use the .NET Framework 1.1?
Changing a datagrid column to read-only=false based on variable

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Windows Development - White Papers, News and Expert Advice
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts