October 10, 2012 at 9:01 pm
October 10, 2012 at 9:02 pm
October 10, 2012 at 10:04 pm
Very simple and easy question 🙂
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
October 10, 2012 at 10:05 pm
bitbucket-25253 (10/10/2012)
Nice simple question on the basics. Every one should get this right (I hope)
I was hoping this too....Not every one got it correct!
Correct answers: 75% (9)
Incorrect answers: 25% (3)
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
October 10, 2012 at 10:24 pm
Lokesh Vij (10/10/2012)
bitbucket-25253 (10/10/2012)
Nice simple question on the basics. Every one should get this right (I hope)I was hoping this too....Not every one got it correct!
Correct answers: 75% (9)
Incorrect answers: 25% (3)
The % of correct should be increased 😀
nice and easy ..
thanks for the question
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
October 11, 2012 at 12:53 am
Easy question for the Thursday...
+1 :-):-P
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
October 11, 2012 at 2:29 am
Good One!
October 11, 2012 at 2:32 am
Good and easy!
October 11, 2012 at 2:38 am
This was removed by the editor as SPAM
October 11, 2012 at 3:19 am
demonfox (10/10/2012)
Lokesh Vij (10/10/2012)
bitbucket-25253 (10/10/2012)
Nice simple question on the basics. Every one should get this right (I hope)I was hoping this too....Not every one got it correct!
Correct answers: 75% (9)
Incorrect answers: 25% (3)
The % of correct should be increased 😀
It should be ... but it isn't!
As of now: ...
Correct answers: 75% (152)
Incorrect answers: 25% (52)
Total attempts: 204
I am absolutely stunned that so many people get this wrong!
October 11, 2012 at 4:08 am
Hugo Kornelis (10/11/2012)
demonfox (10/10/2012)
Lokesh Vij (10/10/2012)
bitbucket-25253 (10/10/2012)
Nice simple question on the basics. Every one should get this right (I hope)I was hoping this too....Not every one got it correct!
Correct answers: 75% (9)
Incorrect answers: 25% (3)
The % of correct should be increased 😀
It should be ... but it isn't!
As of now: ...
Correct answers: 75% (152)
Incorrect answers: 25% (52)
Total attempts: 204
I am absolutely stunned that so many people get this wrong!
And it's actually getting worse:
Correct answers: 74% (177)
Incorrect answers: 26% (63)
It's amazing that so many people can get this wrong. Like Hugo, I'm stunned.
Even if someone doesn't know the answer they could use just a little thinking and application of common sense to get the correct answer, because the consequences for concurrency and performance of requiring the seed to be rolled back would be intolerable.
Tom
October 11, 2012 at 4:14 am
L' Eomot Inversé (10/11/2012)
the consequences for concurrency and performance of requiring the seed to be rolled back would be intolerable.
That's not even the biggest issue. Consider this scenario:
Transaction 1 starts, inserts new row. Identity value used = 12345.
Transaction 2 starts, inserts new row. Identity value used = 12346.
Transaction 1 rolls back.
Transaction 2 inserts two more rows. What identity values to expect?
October 11, 2012 at 5:15 am
Hugo Kornelis (10/11/2012)
L' Eomot Inversé (10/11/2012)
the consequences for concurrency and performance of requiring the seed to be rolled back would be intolerable.That's not even the biggest issue.
It's big enough to kill the idea of restoring seeds, though.
Consider this scenario:
Transaction 1 starts, inserts new row. Identity value used = 12345.
Transaction 2 starts, inserts new row. Identity value used = 12346.
Transaction 1 rolls back.
Transaction 2 inserts two more rows. What identity values to expect?
That's an illustration of why we would have to do something quite unpleasant to resolve the issues with restoring the seed. Actually, it's an overcomplicated illustration: no need to consider further work in Transaction 2, it's bad enough if it just commits its single update. I don't believe there's a reasonable solution. There are at least two unreasonable solutions (which I'm sure would never be implemented):
(i) Transaction 2 is blocked when it attempts to insert, and remains blocked until Transaction 1 commits or rolls back;
(ii) Transaction 2 is aborted immediately when transaction 1 rolls back; If Transaction 1 doesn't roll back, Transaction 2 is not committed until Transaction 1 commits; if Transaction 2 tries to commit it blocks, waiting for transaction 1.; if Transaction 1 rolls back Transaction 2 is rolled back.
In either case, we don't need an answer to your question - with (i) because Transaction 2's insert doesn't happen until after Transaction 1 commits or rolls back, with (ii) because Transaction 2 never gets to its second insert (it rolls back when Transaction 1 rolls back).
Of course we would have to do some things with dbcc checkident too.
(i) would be reasonably simple to implement (although a lock that blocks inserts but not updates would be new), (ii) rather less so (one can end up with an arbitrarily large group of transactions all of which must commit or roll back together).
The consequences of implementing either (i) or (ii) in order to allow the seed to be restored are what I consider intolerable.
Fortunately we don't have any of this nonsense - the seed is not part of the state that has to be restored by rollback.
Tom
Viewing 15 posts - 1 through 15 (of 39 total)
You must be logged in to reply to this topic. Login to reply