February 17, 2010 at 9:16 pm
With an exclusive lock, no other transactions can modify data (except for operations with NOLOCK hint or read uncommitted isolation level)
What???!!! :w00t:
I want my point back!
Unless someone can post code or a reference to show that NOLOCK or READ UNCOMMITTED allows modification of data protected by an exclusive lock!
Grrr!
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
February 17, 2010 at 9:52 pm
I selected the options 1 & 4 and lost it.
I thought the below one is wrong.
"With an exclusive lock, no other transactions can modify data (except for operations with NOLOCK hint or read uncommitted isolation level)"
Though I am microsoft certified, I give a lot wrong answers now a days...haaaaa....I need to concentrate more and more.....
February 17, 2010 at 10:11 pm
Paul White (2/17/2010)
With an exclusive lock, no other transactions can modify data (except for operations with NOLOCK hint or read uncommitted isolation level)What???!!! :w00t:
I want my point back!
Unless someone can post code or a reference to show that NOLOCK or READ UNCOMMITTED allows modification of data protected by an exclusive lock!
Grrr!
I agree with you. I happened to find the article that discusses this and was sure that that option was just a typo and poorly written. So I still selected it - :w00t:
It should be:
read operations can take place only with the use of the NOLOCK hint or read uncommitted isolation level.
This is the only part of the question that I took issue with and am glad that others saw the same thing.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 17, 2010 at 10:22 pm
Edited. I'll clean up points in the am.
February 17, 2010 at 10:23 pm
Joy Smith San (2/17/2010)
I thought the below one is wrong."With an exclusive lock, no other transactions can modify data (except for operations with NOLOCK hint or read uncommitted isolation level)"
I agree with you ๐
It's wrong. Not merely badly phrased...wrong.
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
February 17, 2010 at 10:24 pm
Steve Jones - Editor (2/17/2010)
Edited. I'll clean up points in the am.
You're my favourite SSC Editor, Steve. Thanks. ๐
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
February 17, 2010 at 10:27 pm
Steve Jones - Editor (2/17/2010)
Edited. I'll clean up points in the am.
That was quick.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 18, 2010 at 1:08 am
Steve Jones - Editor (2/17/2010)
Edited. I'll clean up points in the am.
Sorry, but option 1 is still wrong.
Exclusive locks prevent access to a resource by concurrent transactions
Read access is not prevented in case of NOLOCK or READ UNCOMMITTED
So either this option needs to be removed from the correct options, or it needs to be reworded to show that write access to a resource is prevented and not read access.
Best Regards,
Chris Bรผttner
February 18, 2010 at 1:40 am
Christian Buettner-167247 (2/18/2010)
Steve Jones - Editor (2/17/2010)
Edited. I'll clean up points in the am.Sorry, but option 1 is still wrong.
Exclusive locks prevent access to a resource by concurrent transactions
Read access is not prevented in case of NOLOCK or READ UNCOMMITTED
So either this option needs to be removed from the correct options, or it needs to be reworded to show that write access to a resource is prevented and not read access.
I agree. Because of that I got wrong answer ๐
If you don't like how things are, change it! You're not a tree.
February 18, 2010 at 6:15 am
Christian Buettner-167247 (2/18/2010)
Sorry, but option 1 is still wrong.Exclusive locks prevent access to a resource by concurrent transactions
Read access is not prevented in case of NOLOCK or READ UNCOMMITTED
Exactly. Another option is 'ALTER DATABASE xxx SET READ_COMMITTED_SNAPSHOT ON'. This, unlike NOLOCK, does not violate one of the ACID principles (isolation).
I am also puzzled with the fourth answer:
Data modification statements typically request both shared locks and exclusive locks
The word 'typically' is so vague. For example, typically I work with databases with the READ_COMMITTED_SNAPSHOT option turned on. Data modification statements typically don't request shared locks in this case. So I didn't select the fourth answer.
February 18, 2010 at 6:30 am
Exclusive locks prevent access to a resource by concurrent transactions
Just a small correction is needed:
Exclusive locks prevent write access to a resource by concurrent transactions
vk-kirov (2/18/2010)
I am puzzled with the fourth answer:Data modification statements typically request both shared locks and exclusive locks
The word 'typically' is so vague. For example, typically I work with databases with the READ_COMMITTED_SNAPSHOT option turned on. Data modification statements typically don't request shared locks in this case. So I didn't select the fourth answer.
I disagree. The majority of databases don't run under one of the row-versioning isolation levels, so use of the word 'typically' is justified.
The default isolation level in SQL Server is, and has always been, READ COMMITTED.
At that level of isolation, shared locks (or maybe update locks if requested) are taken by the read cursor, and escalated to exclusive locks by the write cursor if the row qualifies for modification.
I understand that you don't see shared locks very often in your environment (though you must have used WITH READCOMMITTEDLOCK at some stage!) but you should still be aware of the default behaviour.
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
February 18, 2010 at 10:37 am
Paul White (2/17/2010)
With an exclusive lock, no other transactions can modify data (except for operations with NOLOCK hint or read uncommitted isolation level)
What???!!! :w00t:
I want my point back!
Unless someone can post code or a reference to show that NOLOCK or READ UNCOMMITTED allows modification of data protected by an exclusive lock!
Grrr!
With an exclusive lock, no other transactions can modify data (read operations with NOLOCK hint or read uncommitted isolation level can take place),
The above choice states clearly that no other transaction can MODIFY data - which is correct; that being said, Read operations with NOLOCK hint or under read uncommitted isolation level can certain take place - REFER to the following link ----- http://www.sqlteam.com/article/introduction-to-locking-in-sql-server (exclusive lock section)
Exclusive locks prevent write access to a resource by concurrent transactions ,
I don't think there is any ambiguity in this choice - it is clear enough and correct - X Locks prevents any concurrent write access
Data modification statements typically request both shared locks and exclusive locks
I must admit that I was momentarily confused by the wording of this choice - I only answered it from gut feel; Typically DML operations should take an UPDATE lock; While Shared locks can be escalated to an exclusive lock when the DML kicks in, it can end up in a deadlock if another transaction (under shared lock mode) attempts to update the same data. To prevent this situation Update locks are used. Saying that Data Modification statements typically REQUEST both shared and exclusive locks does lead to an ambiguous situation. It could have been more appropriately worded.
Saurabh Dwivedy
___________________________________________________________
My Blog: http://tinyurl.com/dwivedys
For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537
February 18, 2010 at 10:48 am
Saurabh Dwivedy (2/18/2010)
Paul White (2/17/2010)
With an exclusive lock, no other transactions can modify data (except for operations with NOLOCK hint or read uncommitted isolation level)
What???!!! :w00t:
I want my point back!
Unless someone can post code or a reference to show that NOLOCK or READ UNCOMMITTED allows modification of data protected by an exclusive lock!
Grrr!
With an exclusive lock, no other transactions can modify data (read operations with NOLOCK hint or read uncommitted isolation level can take place),
The above choice states clearly that no other transaction can MODIFY data - which is correct; that being said, Read operations with NOLOCK hint or under read uncommitted isolation level can certain take place - REFER to the following link ----- http://www.sqlteam.com/article/introduction-to-locking-in-sql-server (exclusive lock section)
Exclusive locks prevent write access to a resource by concurrent transactions ,
I don't think there is any ambiguity in this choice - it is clear enough and correct - X Locks prevents any concurrent write access
Data modification statements typically request both shared locks and exclusive locks
I must admit that I was momentarily confused by the wording of this choice - I only answered it from gut feel; Typically DML operations should take an UPDATE lock; While Shared locks can be escalated to an exclusive lock when the DML kicks in, it can end up in a deadlock if another transaction (under shared lock mode) attempts to update the same data. To prevent this situation Update locks are used. Saying that Data Modification statements typically REQUEST both shared and exclusive locks does lead to an ambiguous situation. It could have been more appropriately worded.
The question originally stated (in essence) that a nolock hint could be used to modify while an exclusive lock was held. It has been changed since. Paul wasn't disputing that a read could happen while using the nolock hint if an exclusive lock was held - just that the wording was wrong and thus made that option incorrect.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 18, 2010 at 10:52 am
Wording has been changed to make this more clear. I am awarding back points as well.
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply