SQL Server 2008/2005 Concurrency control with locks

SQL Server 2008 Extended Events 3

Now lets create a New Event Session to capture Deadlock Victims IF EXISTS(SELECT * FROM sys.server_event_sessions WHERE name=’Demo_session_Deadlock’) DROP EVENT SESSION Demo_session_Deadlock ON SERVER GO — CREATES THE SESSION CREATE EVENT SESSION Demo_session_Deadlock ON SERVER ADD EVENT sqlserver.lock_deadlock ( ACTION ( sqlserver.database_id, sqlserver.client_app_name, sqlserver.sql_text ) ) ADD TARGET package0.asynchronous_file_target — CONFIGURES THE FILE TARGET (set…

SQL Server Optimistic Concurrency

SQL Server Concurrency Terminology Optimistic concurrency control inside the SQL Server 2005/2008 database engine technically means that row versioning is used instead of a pessimistic locking approach. I believe this is a source of much confusion to both application developers and DBAs because row versioning isn’t required for applications to use optimistic concurrency control by…