This document provides an overview of concurrency problems and locking techniques in SQL Server 2000 and VB.NET. It discusses topics such as lost updates, uncommitted dependencies, inconsistent analysis, and phantom reads. It also covers isolation levels including read committed, read uncommitted, repeatable read, and serializable. Finally, it summarizes transactions in SQL Server including Transact-SQL statements, nested transactions, and savepoints.
New gTLDs between two rounds: trade mark challenges
▶ gTLDs: first round of applications’ results: who registered and why?
▶ Transparency: how did TM owners find their way through new gTLD application system?
▶ More gTLDs, more disputes? Will cybersquatting increase?
▶ trade mark protection mechanisms: all about uniform rapid suspension system, pre-emptive registration period and trade mark clearinghouse
Una antigua presentación sobre UDFs en SQL Server. la primera vez que presenté una sesión en público con Miguel Egea, en la conferencia PortalFox, en Coruña, España, en febrero del 2003
New gTLDs between two rounds: trade mark challenges
▶ gTLDs: first round of applications’ results: who registered and why?
▶ Transparency: how did TM owners find their way through new gTLD application system?
▶ More gTLDs, more disputes? Will cybersquatting increase?
▶ trade mark protection mechanisms: all about uniform rapid suspension system, pre-emptive registration period and trade mark clearinghouse
Una antigua presentación sobre UDFs en SQL Server. la primera vez que presenté una sesión en público con Miguel Egea, en la conferencia PortalFox, en Coruña, España, en febrero del 2003
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 4
Vda305 concurrency guerrero
1. Session
VDA305
Concurrency problems and
locking techniques in SQL
Server 2000 and VB.NET
Fernando G. Guerrero
SQL Server MVP
.NET Technical Lead
QA plc
October 2002
2. Quick info about Fernando
(2 milliseconds)
• MCSD, MCSE+Internet (W2K), MCDBA, MCT,
QA
SQL Server MVP
• This is where I work: QA, The best learning
environment in Europe
• Writing for SQL Sever Magazine and SQL
Server Professional
• This is my main web site: www.callsql.com
• This is my book (so far):
– Microsoft SQL Server 2000 Programming by
Example (ISBN : 0789724499, co-authored with Carlos
Eduardo Rojas)
• Currently writing on ADO.NET and SQL Server
2000
VS .NET Connections
4. Concurrency problems
• Lost Updates
• Uncommitted Dependency
• Inconsistent Analysis
• Phantom Reads
VS .NET Connections 4
5. Lost Updates (1)
Peter Paul
Peter UnitPric UnitPric
Paul
e e
10.0 10.0
VS .NET Connections
Mary
5
(SQL Server)
6. Lost Updates (2)
Peter Paul
Peter UnitPric @UP * UnitPric
Paul
e 1.2 e
10.0 12.0 10.0
DECLARE @UP money
SELECT @UP = UnitPrice
FROM Products
WHERE ProductID = 25
VS .NET Connections
Mary
6
(SQL Server)
7. Lost Updates (3)
Peter Paul
Peter UnitPric @UP * UnitPric @UP *
Paul
e 1.2 e 1.1
10.0 12.0 10.0 11.0
DECLARE @UP money
DECLARE @UP money
SELECT @UP = UnitPrice
FROM Products
WHERE ProductID = 25
SELECT @UP = UnitPrice
FROM Products
WHERE ProductID = 25
VS .NET Connections
Mary
7
(SQL Server)
8. Lost Updates (4)
Peter Paul
Peter UnitPric @UP * UnitPric @UP *
Paul
e 1.2 e 1.1
DECLARE @UP money 12.0 12.0 12.0 11.0 DECLARE @UP money
SELECT @UP = UnitPrice SELECT @UP = UnitPrice
FROM Products FROM Products
WHERE ProductID = 25 WHERE ProductID = 25
UPDATE Products
SET UnitPrice =
@UP * 1.2
WHERE ProductID = 25
VS .NET Connections
Mary
8
(SQL Server)
9. Lost Updates (5)
Peter Paul
Peter UnitPric @UP * UnitPric @UP *
Paul
e 1.2 e 1.1
DECLARE @UP money 11.0 12.0 11.0 11.0 DECLARE @UP money
SELECT @UP = UnitPrice SELECT @UP = UnitPrice
FROM Products FROM Products
WHERE ProductID = 25 WHERE ProductID = 25
UPDATE Products
SET UnitPrice = @UP * 1.2
WHERE ProductID = 25 UPDATE Products
SET UnitPrice =
@UP * 1.1
WHERE ProductID = 25
VS .NET Connections
Mary
9
(SQL Server)
10. Uncommitted Dependency (1)
Peter Paul
Peter UnitPric UnitPric
Paul
e e
10.0 10.0
VS .NET Connections
Mary
10
(SQL Server)
11. Uncommitted Dependency (2)
Peter Paul
Peter UnitPric UnitPric
Paul
e e
12.0 12.0
BEGIN TRANSACTION
UPDATE PRODUCTS
SET UnitPrice =
UnitPrice * 1.2
WHERE ProductID = 25
VS .NET Connections
Mary
11
(SQL Server)
12. Uncommitted Dependency (3)
Peter Paul
Peter UnitPric UnitPric @UP
Paul
e e
12.0 12.0 12.0
BEGIN TRANSACTION
DECLARE @UP money
UPDATE PRODUCTS
SET UnitPrice = UnitPrice * 1.2
WHERE ProductID = 25
SELECT @UP = UnitPrice
FROM Products (NOLOCK)
WHERE ProductID = 25
VS .NET Connections
Mary
12
(SQL Server)
13. Uncommitted Dependency (4)
Peter Paul
Peter UnitPric UnitPric @UP
Paul
e e
BEGIN TRANSACTION 12.0
10.0 12.0
10.0 12.0 DECLARE @UP money
UPDATE PRODUCTS SELECT @UP = UnitPrice
SET UnitPrice = UnitPrice * 1.2 FROM Products
WHERE ProductID = 25 WHERE ProductID = 25
ROLLBACK TRANSACTION
VS .NET Connections
Mary
13
(SQL Server)
14. Uncommitted Dependency (5)
Peter Paul
Peter UnitPric UnitPric @UP
Paul
e e
BEGIN TRANSACTION 10.0 10.0 12.0 DECLARE @UP money
UPDATE PRODUCTS SELECT @UP = UnitPrice
SET UnitPrice = UnitPrice * 1.2 FROM Products
WHERE ProductID = 25 WHERE ProductID = 25
ROLLBACK TRANSACTION
INSERT [Order details]
(
OrderID,
ProductID,
UnitPrice,
Quantity,
Discount)
VALUES (25365, 25,
VS .NET Connections
Mary @UP, 10, 0.1)
14
(SQL Server)
16. Inconsistent Analysis (2)
Peter
Peter @Count 830 Paul
@Total
@Average
@Total /
DECLARE @Count int,
@Count
@Total money,
@Average money
SELECT @Count =
COUNT(DISTINCT
OrderID)
FROM .NET Connections
VS
[Order Details] Mary 16
(SQL Server)
17. Inconsistent Analysis (3)
Peter
Peter @Count 830 Paul
@Total
DECLARE @Count int,
@Total money, @Average
@Average money
SELECT @Count = @Total /
COUNT(DISTINCT OrderID) @Count
FROM [Order Details]
UPDATE [Order details
SET Quantity = 600
WHERE OrderID = 10272
AND ProductID = 20
VS .NET Connections
Mary
17
(SQL Server)
18. Inconsistent Analysis (4)
Peter
Peter @Count 830 Paul
@Total 1304284.2
DECLARE @Count int, 4 UPDATE [Order details]
@Total money, SET Quantity = 600
@Average money @Average WHERE OrderID = 10272
SELECT @Count = AND ProductID = 20
COUNT(DISTINCT OrderID) @Total / 1571.43
FROM [Order Details]
@Count
SELECT @Total =
SUM(UnitPrice *
Quantity *
(1 – Discount))
FROM [Order Details]
VS .NET Connections
Mary
18
(SQL Server)
19. Inconsistent Analysis (5)
Peter
Peter @Count 830 Paul
@Total 1304284.2
DECLARE @Count int, 4 UPDATE [Order details]
@Total money, SET Quantity = 600
@Average money @Average WHERE OrderID = 10272
SELECT @Count = AND ProductID = 20
COUNT(DISTINCT OrderID) @Total / 1571.43
FROM [Order Details]
@Count
SELECT @Total =
SUM(UnitPrice *
Quantity *
(1 – Discount))
FROM [Order Details] UPDATE [Order
details]
SET Discount = 0.4
WHERE ProductID =
VS .NET Connections
Mary20
19
(SQL Server)
20. Inconsistent Analysis (6)
Peter
Peter @Count 830 Paul
@Total 1304284.2
DECLARE @Count int, 4 UPDATE [Order details]
@Total money, SET Quantity = 600
@Average money @Average 1542.78 WHERE OrderID = 10272
SELECT @Count = AND ProductID = 20
COUNT(DISTINCT OrderID) @Total / 1571.43
FROM [Order Details]
@Count UPDATE [Order details]
SET Discount = 0.4
SELECT @Total = WHERE ProductID = 20
SUM(UnitPrice *
Quantity *
(1 – Discount))
FROM [Order Details]
SELECT @Average =
AVG(TotalPrice)
FROM (…) AS TotOrders
VS .NET Connections
Mary
20
(SQL Server)
21. Phantom Reads (1)
OrderID ProductI UnitPrice
Peter D Paul
10259 37 20.8
10337 37 20.8
10408 37 20.8
10523 37 26.0
10847 37 26.0
10966 37 26.0
SELECT OrderID,
ProductID,
UnitPrice
FROM [Order Details]
WHERE ProductID = 37
VS .NET Connections
Mary
21
(SQL Server)
22. Phantom Reads (2)
OrderID ProductI UnitPrice
Peter D Paul
10259 37 20.80
10337 37 20.80
SELECT OrderID,
ProductID, 10408 37 20.80
UnitPrice
FROM [Order Details] 10523 37 26.00
WHERE ProductID = 37
10847 37 26.00
10966 37 26.00
10615 37
INSERT [Order
31.54
details]
(OrderID,
ProductID,
UnitPrice,
MaryQuantity,
(SQL Server) Discount)
VS .NET Connections 22
23. Phantom Reads (3)
OrderID ProductI UnitPrice
Peter D Paul
10259 37 20.80
10337 37 20.80
SELECT OrderID, INSERT [Order details]
ProductID, 10408 37 20.80 (OrderID, ProductID,
UnitPrice UnitPrice, Quantity,
FROM [Order Details] 10523 37 26.00
Discount)
WHERE ProductID = 37
10847 37 26.00 VALUES (10615, 37,
31.54, 20, 0.1)
10966 37 26.00
10615 37 31.54
SELECT OrderID,
ProductID,
UnitPrice
FROM [Order Details]
WHERE ProductID = 37
VS .NET Connections
Mary
23
(SQL Server)
24. Isolation levels
• Transact-SQL:
– READ COMMITTED
– READ UNCOMMITTED
– REPEATABLE READ
– SERIALIZABLE
• Extra .NET Isolation Levels:
– Chaos (not valid for SQLClient)
– Unspecified (not settable for SQLClient)
VS .NET Connections 24
25. Isolation levels vs. Concurrency
problems
P Problem
Isolation
S Solution
Level
X
SERIALIZABLE
solved by standard
UNCOMMITTED
REPEATABLE
COMMITTED
exclusive locks
READ
READ
READ
inside
transactions
Concurrency
Problem
Lost
Update
X X X X
Dirty Read P S S S
Inconsiste
VS .NET Connections nt P P S S 25
Analysis
26. READ COMMITTED
• Default isolation level
• Avoids Dirty Reads
– m yTr =
an
m yconn.Begi ans i Iol i
nTr acton( s atonLevelReadCom m it
. t
ed)
–S ELECT … FRO M … W I (
TH READCO M M I
TTED)
–S ELECT … FRO M … W I (
TH READPAS T)
– S TRANS
ET ACTI N IO LATI N LEVEL READ CO M M I
O S O TTED
• Requests Shared locks for the duration of the
reading operation
• Requests Exclusive locks for each modification 26
VS .NET Connections
27. READ UNCOMMITTED
• Isolation level only suitable for “sneaking
around”
– m yTr =
an
m yconn.Begi ans i Iol i
nTr acton( s atonLevelReadUnCom m
.
it
ted)
–S ELECT … FRO M … W I (
TH READUNCO M M ITTED)
–S ELECT … FRO M … W I ( LO CK)
TH NO
– S TRANS
ET ACTI N IO LATI N LEVEL READ UNCO M M I
O S O TTED
• Doesn’t request Shared locks at all
• Requests Exclusive locks for each modification
VS .NET Connections 27
28. REPEATABLE READ
• Quite a restrictive isolation level
• Avoids all concurrency problems, except
Phantom Reads
– m yTr =
an
m yconn.Begi ans i Iol i
nTr acton( s atonLevelRepeat eRe
. abl
ad)
–S ELECT … FRO M … W I (
TH REPEATABLEREAD)
– S TRANS
ET ACTI N IO LATI N LEVEL REPEATABLE READ
O S O
• Requests Shared locks for the duration of the
transaction
• Requests Exclusive locks for each modification 28
VS .NET Connections
29. SERIALIZABLE
• The most restrictive isolation level
• Avoids all concurrency problems
– m yTr =
an
m yconn.Begi ans i Iol i
nTr acton( s atonLevelS i i e)
. eralzabl
–S ELECT … FRO M … W I ( ERI ZABLE)
TH S ALI
–S ELECT … FRO M … W I ( LDLO CK)
TH HO
– S TRANS
ET ACTI N IO LATI N LEVEL S ALI
O S O ERI ZABLE
• Requests Shared locks for the duration of the
transaction
• Requests Exclusive locks for each modification
VS .NET Connections 29
34. Nested transactions
• @@TRANCOUNT tells you how many
transaction levels you are in
• For SQL Server there is only one actual
transaction
• Commit happens only when all nested
transactions are ended
• Rollback cancels all nested transactions at
once
VS .NET Connections 34
35. Transactions and Stored
Procedures
• After Rollback execution continues, but you are
outside transaction boundaries
• If Rollback happens inside a procedure, the
calling process receives error 266, Level 16:
– Transaction count after EXECUTE indicates that a
COMMIT or ROLLBACK TRANSACTION statement is
missing. Previous count = 1, current count = 0.
• Good idea to use save points and inform the
outer process using output parameters
VS .NET Connections 35
36. Transactions and Triggers
• After Rollback execution continues inside
the trigger, but you are outside transaction
boundaries and the process terminates
when the trigger does.
• Consider using INSTEAD OF triggers to
minimize rollbacks
• Consider using cancelling operations
instead of rollbacks
VS .NET Connections 36
39. .NET Automatic transactions
• Apply the TransactionAttribute to your class.
• Derive your class from the
ServicedComponent Class.
• Sign the assembly with a strong name.
– To sign the assembly using attributes create a
key pair using the Sn.exe utility.
– sn -k MCTCon.snk
VS .NET Connections 39
40. .NET Automatic transactions (2)
<Assembly: ApplicationName("MCTCON")>
<Assembly: AssemblyKeyFileAttribute("MCTCON.snk")>
<Transaction(TransactionOption.Required)> Public Class clsProduct
Inherits ServicedComponent
Dim myConnection As SqlConnection
<AutoComplete()> Public Sub RaisePrice(ByVal ProductID As Integer, ByVal
amount As Integer)
OpenConnection()
Updateproduct(ProductID, amount)
CloseConnection()
End Sub
VS .NET Connections 40
49. Hunting for locks
• Profiler can detect locks
• Performance Monitor counts locks
• Transaction Log registers transactions. It
doesn’t register locks
• Convert sp_lock into fn_lock
SELECT *
FROM ::fn_lock()
WHERE Status = 'WAIT'
VS .NET Connections 49
53. Locking techniques from ADO.NET
• Optimistic concurrency
• Pessimistic concurrency
• User-defined concurrency
VS .NET Connections 53
54. Optimistic concurrency
• Default behavior from DataAdapter
• Based on sp_executesql
• SET clause with all new values:
– Updated columns
– Unchanged columns
• WHERE clause with all old values:
– Updated columns
– Unchanged columns
VS .NET Connections 54
55. Pessimistic Concurrency
• Implemented through SqlCommand
objects and stored procedures
• Not scaleable:
– Requires maintaining connection open
– Open transaction
– Too much locking for too much time
• Necessary in some scenarios
VS .NET Connections 55
60. Do you want to know more?
• “Inside SQL Server 2000” (Kalen Delaney, MSPress)
• “Advanced Transact-SQL for SQL Server 2000” (Itzik
Ben-Gan & Tom Moreau, APress)
• “SQL Server 2000 Programming” (Robert Vieira, WROX)
• “Microsoft SQL Server 2000 Programming by Example”
(Fernando G. Guerrero & Carlos Eduardo Rojas, QUE)
• SQL Server 2000 Resource Kit (MSPress & TechNet)
• Visit the Microsoft public newsgroups:
– msnews.microsoft.com/microsoft.public.sqlserver.*
• Download the source code of this session from:
– http://www.callsql.com/en/articles
VS .NET Connections 60
61. Do you want to know even
more?
• Visit the Microsoft public newsgroups:
– msnews.microsoft.com/microsoft.public.sql
server.*
– msnews.microsoft.com/microsoft.public.dot
net.*
VS .NET Connections 61
62. Thank you!
Questions?
• Download the source code of this
session from:
– http://www.callsql.com/en/articles
• You can contact me at:
– fernan@guerrerog.org
VS .NET Connections
63. Thank you!
• Please drop off your
session evaluations in
the basket at the back
of the room!
• Your comments are
greatly appreciated!
VS .NET Connections