Problems occur while implement locking in sql server, DOT NET Programming

Assignment Help:

What are the problems that can occur if you do not implement locking properly in SQL SERVER?

The problems that occur if you do not implement locking properly in SQL SERVER is as follows:

Lost Updates:

The Lost updates occurs if you let two transactions change the same data at the same time, and the transaction which completes first is lost. You requireto watch out for the lost updates with the READ UNCOMMITTED isolation level. This isolation level disregards any type of locks, so two simultaneous data modifications are not aware of each other. Suppose that the customer has due of 2000$ to be paid. He paid 1000$ & again buys a product of 500$. Now say that these two transactions are now been entered from two different counters of the company. Now both counter user starts making entry at the same time 10:00 AM. Actually say at 10:01 AM the customer should have 2000$-1000$+500 = 1500$ pending to be paid. But as said in the lost updates the first transaction is not considered and the second transaction overrides it. So the final pending is 2000$+500$ = 2500$.....I hope the company does not loose the customer.

Non-Repeatable Read:

The Non-repeatable reads occurs if a transaction is able to read the similar row multiple times and gets a different value every time. Again, this problem is most likely to occur with the READ UNCOMMITTED isolation level. Because you let two transactions change data at the similar time, you can get some unexpected results. For an instance, a customer wants to book flight, so the travel agent checks for the flights availability. The Travel agent finds a seat and goes ahead to book the seat.While the travel agent is booking the seat, some another travel agent books the seat. When the travel agent goes to update the record, he gets error saying that "Seat is already booked". In brief the travel agent gets different status at the different times for the seat.

Dirty Reads:

The Dirty reads are a special case of non-repeatable read. This happens only if you run a report while transactions are changing the data that you're reporting on. For example there is a customer invoice report which runs on 1:00 AM in the afternoon and after that all invoices are sent to the respective customer for payments. Let us say one of the customer has 1000$ to be paid. The Customer pays 1000$ at 1:00 AM and at the same time report is run. Actually the customer has no money pending but is still issued an invoice.

Phantom Reads:

The Phantom reads occur due to a transaction being able to read a row on the first read, but not being able to change the same row due to another transaction deleting rows from the similar table. Lets say you edit a record in the mean time someone comes and deletes the record, you then go for updating the record which does not exist.Panicked. Interestingly, the phantom reads can occur even with the default isolation level supported by the SQL Server: READ COMMITTED. The only isolation level that doesn't allow phantoms is SERIALIZABLE, which assures that every transaction is completely isolated from others. In other words, no one can acquire any type of locks on the affected row while it is being changed.


Related Discussions:- Problems occur while implement locking in sql server

Basic methods of data adapter, What are basic methods of Data adapter? ...

What are basic methods of Data adapter? The three most commonly used methods of Dataadapter are as follows:- 1)Fill :- It Executes the SelectCommand to fill the DataSet ob

Uml, What is UML? The Unified Modeling Language (UML) is a graphical la...

What is UML? The Unified Modeling Language (UML) is a graphical language for documenting, specifying, visualizing,  constructing, and  the artifacts of a software-intensive sys

Ui design for a website, Project Description: I have a website that I ha...

Project Description: I have a website that I have prepared, but I would like someone to make it look nicer. Most of the functionality is there, but I need help with design which

Grid view related query, i want to know how can i sum quantity column in g...

i want to know how can i sum quantity column in gridview and place it in first row...not in footer..in .net. Rply ASAP

Dataset object, What is Dataset object ? The DataSet gives the basis fo...

What is Dataset object ? The DataSet gives the basis for the disconnected storage and manipulation of the relational data. We fill it from the  data store, work with it while d

Bug correction and prediction, Bug Correction and Prediction Project Des...

Bug Correction and Prediction Project Description: The project is about the prediction of bugs and resolves the bug in the sample program using costriage algorithm. You have

Jquery and mvc 4.5 training session, Jquery and MVC 4.5 Training Session ...

Jquery and MVC 4.5 Training Session I am looking who have industry experience working on Microsoft Technology ( MVC 4.5 ) and Jquery, who will take live online session and provi

What is an identifier, What is an identifier? Identifiers are northing ...

What is an identifier? Identifiers are northing but names given to various entities uniquely identified in a program. The name of identifiers must vary in spelling or casing. F

Different types of jit, JIT compiler is the part of the runtime execution e...

JIT compiler is the part of the runtime execution environment. In Microsoft .NET there are three types  of JIT compilers are available: 1) Pre-JIT :- The Pre-JIT compiles the co

Sql injection, What is SQl injection? This is a Form of attack on the  ...

What is SQl injection? This is a Form of attack on the  database-driven Web site in which the attacker executes the unauthorized SQL commands by taking merits of insecure code

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd