Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Transaction


Transaction

Author
Message
Mohan Kumar
Mohan  Kumar
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1341 Visits: 596
Comments posted to this topic are about the item Transaction

--www.sqlvillage.com
SuperDBA-207096
SuperDBA-207096
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1475 Visits: 711
Excellent question! So many SQL developers don't understand the difference between isolation levels and the impact of using them!
umailedit
umailedit
SSC-Addicted
SSC-Addicted (411 reputation)SSC-Addicted (411 reputation)SSC-Addicted (411 reputation)SSC-Addicted (411 reputation)SSC-Addicted (411 reputation)SSC-Addicted (411 reputation)SSC-Addicted (411 reputation)SSC-Addicted (411 reputation)

Group: General Forum Members
Points: 411 Visits: 245
It seems primitive to require locks for any read operation. In Oracle I think readers don't lock/block anything.
GSquared
GSquared
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14375 Visits: 9729
umailedit (7/16/2008)
It seems primitive to require locks for any read operation. In Oracle I think readers don't lock/block anything.


Somehow I doubt that Oracle defaults to dirty reads, so what does it do when one connection selects data that another connection is in the process of updating or deleting?

- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread

"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
Jan Van der Eecken
Jan Van der Eecken
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2212 Visits: 6490
The answer doesn't seem to be 100 percent accurate. If you look up BOL ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/016fb05e-a702-484b-bd2a-a6eabd0d76fd.htm under SNAPSHOT ISOLATION it reads:

Except when a database is being recovered, SNAPSHOT transactions do not request locks when reading data.


and a litle further down

During the roll-back phase of a database recovery, SNAPSHOT transactions will request a lock if an attempt is made to read data that is locked by another transaction that is being rolled back. The SNAPSHOT transaction is blocked until that transaction has been rolled back. The lock is released immediately after it has been granted.


Am I missing something (again)?

--------------------------------------------------------------------------
A little knowledge is a dangerous thing (Alexander Pope)

In order for us to help you as efficiently as possible, please read this before posting (courtesy of Jeff Moden)
A_A_R_T
A_A_R_T
SSC Veteran
SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)SSC Veteran (286 reputation)

Group: General Forum Members
Points: 286 Visits: 423
Jan Van der Eecken (7/16/2008)
The answer doesn't seem to be 100 percent accurate. If you look up BOL ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/016fb05e-a702-484b-bd2a-a6eabd0d76fd.htm under SNAPSHOT ISOLATION it reads:

Except when a database is being recovered, SNAPSHOT transactions do not request locks when reading data.


and a litle further down

During the roll-back phase of a database recovery, SNAPSHOT transactions will request a lock if an attempt is made to read data that is locked by another transaction that is being rolled back. The SNAPSHOT transaction is blocked until that transaction has been rolled back. The lock is released immediately after it has been granted.


Am I missing something (again)?

That's exactly what I found!

Can someone explain this please?
Steven Cameron
Steven Cameron
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2057 Visits: 215
To me it sounds like SNAPSHOT transactions issue a shared lock request so that it will wait until the rolled back transaction or database recovery has been completed. Once that is done, the lock is released. So it doesn't required it for the read transaction itself.
Steven Cameron
Steven Cameron
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2057 Visits: 215
umailedit (7/16/2008)
It seems primitive to require locks for any read operation. In Oracle I think readers don't lock/block anything.


Then why does Google come up with 1,380,000 results for Oracle Locking?
Christian Buettner-167247
Christian Buettner-167247
SSCrazy
SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)SSCrazy (2.9K reputation)

Group: General Forum Members
Points: 2949 Visits: 3889
umailedit (7/16/2008)
It seems primitive to require locks for any read operation. In Oracle I think readers don't lock/block anything.

Hi umailedit,

can you please elaborate a little more on why you think that pessimistic locking is primitive?
I think that both locking mechanisms (optimistic and pessimistic) have their deserved place in todays database technology. The benefit of SQL Server is that you can choose between optimistic an pessimistic locking. In oracle you can't. (But the overhead of SQL Server optimistic locking seems to be more drastic than in oracle.)

For more good comparison of the locking types mvrc, mvcc and pessimistic locking, I suggest the following reading:
http://www.ibphoenix.com/main.nfs?page=ibp_mvcc_roman
Edit: Fixed Url tags.

Best Regards,

Chris Büttner
Anipaul
Anipaul
SSCertifiable
SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)SSCertifiable (6.3K reputation)

Group: General Forum Members
Points: 6275 Visits: 1407
Excellent question ....



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search