LINQ to SQL combining read uncommitted and read committed?

"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!

ReadCommitted or ReadUncommitted does not matter on a SubmitChanges() because it is a write, not a read. No matter what the isolation level, an update always acquires a lock and respects existing locks. It has to, that is the main purpose of locks Of course, by updating uncommitted data you run the risk that the record does not even still exist to be updated, but that was the risk you accepted when deciding to be optimistic.

ReadCommitted or ReadUncommitted does not matter on a SubmitChanges() because it is a write, not a read. No matter what the isolation level, an update always acquires a lock and respects existing locks. It has to, that is the main purpose of locks.

Of course, by updating uncommitted data you run the risk that the record does not even still exist to be updated, but that was the risk you accepted when deciding to be optimistic.

I'm not sure that's true. LINQ to SQL needs to check on the ROWVERSION field to check for optimistic concurrency conflicts before it commits the changes. My concern was that it might continue using my transaction's isolation level of ReadUncommitted in the concurrency check.

– Jono Sep 8 at 12:01 Transaction isolation level is unrelated to the concurrency check. – DevDelivery Sep 8 at 12:21 I guess you are thinking that the concurrency check first does a read to check concurrency and, if it is ok, does the update. However, the concurrency check is built into the update statement itself and as I pointed out in the answer, Update always respects locks.

– DevDelivery Sep 8 at 12:31 Yes, I thought that's what happened. I guess I could look at the Log output to verify that it's just a solitary update, which - you are correct in pointing out - always takes out locks. If this is the case, then I can get by with a single TransactionScope for building up the entities in the context... – Jono Sep 8 at 12:43 thanks, it looks like you're right.

The UPDATE statement itself is the concurrency check: it uses the ROWVERSION field in the WHERE clause. – Jono Sep 8 at 12:55.

I'd like to use LINQ to SQL as the data layer for an application. Optimistic concurrency seems like it would work, but I'd like to be over-optimistic and not bother with any locking (e.g. WITH (NOLOCK)) until I get to SubmitChanges(), at which point I think it's OK to use ReadCommitted. Does this sound like madness?

Is it better to use two disjunct TransactionScope objects (one for reading with ReadUncommitted, followed by a second for submitting changes with ReadCommitted), or is there some nicer way I can raise the isolation level immediately before submitting changes?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions