There will always be locking inside your SQL Server box! In this session we go deep into how locking mechanism works, what are the main problems around locking, how we can resolve them and when isolation levels can actually be of help!
The nightmare of locking, blocking and isolation levelsBoris Hristov
This document discusses transaction locking and isolation levels in SQL Server. It begins with an introduction to locks, their types (shared, update, exclusive), and how they are used for concurrency control. It then covers locking troubleshooting topics like lock escalation, deadlocks, and blocking. The document concludes with an overview of the different transaction isolation levels in SQL Server, including the tradeoffs between pessimistic and optimistic concurrency control approaches.
Welcome to the nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
Replay your workload as it is your actual one! Boris Hristov
This document provides an overview of SQL Server Distributed Replay, a feature that allows replaying SQL Server workloads against test environments. It discusses the components of Distributed Replay, including the administration tool, controller, clients, and target server. The document outlines the basic steps to set up Distributed Replay and replay a workload, including capturing a trace, preprocessing it, deciding replay options, and replaying the trace. Resources for learning more about Distributed Replay are also provided.
The nightmare of locking, blocking and isolation levels!Boris Hristov
am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The Nightmare of Locking, Blocking and Isolation Levels!Boris Hristov
This document provides an overview of locking, blocking, and transaction isolation levels in SQL Server. It begins with an introduction to locking and how SQL Server uses locks for concurrency control. It then discusses the different lock types, lock compatibility, and the lock hierarchy. The document demonstrates how to view locking information and troubleshoot locking problems. It also covers lock escalation, deadlocks, and resolving blocking issues. Finally, it concludes with an explanation of the various transaction isolation levels supported by SQL Server and how they differ in terms of concurrency and consistency.
Welcome to the nightmare of locking, blocking and isolation levels!Boris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
Replay your workload as it is your actual one! Boris Hristov
Have you ever wanted to replay your application workload be that because you upgraded to a new hardware, added new indexes or something else? Now there's a feature for that! It's called Distributed Replay and in this session you will learn how this new feature in SQL Server 2012 can help you resolve that problem!
Database Transactions and SQL Server ConcurrencyBoris Hristov
The document discusses database transactions and transaction management. It begins with an overview of transactions, their properties (atomicity, consistency, isolation, durability known as ACID), and how they are implemented using locks in SQL Server. It then covers transaction isolation levels, locking concepts like lock types and escalation, and how to troubleshoot locking problems including deadlocks. The document provides examples of transactions in SQL Server and demonstrations of managing transactions and concurrency.
Transactions are used to ensure data integrity and manage concurrent access in SQL Server. There are two types of transactions: implicit, which automatically commit after each statement, and explicit, which require BEGIN, COMMIT, or ROLLBACK statements. Transactions have ACID properties including atomicity, consistency, isolation, and durability. Isolation levels like read committed and serializable control how transactions see concurrent data modifications. Snapshot isolation is an alternative to locking that uses row versioning to provide consistency.
This document provides an outline for a presentation on concurrency in SQL Server. The presentation introduction discusses sessions, locking, blocking, deadlocks, and pressure. It then covers transactions, isolation levels, and phenomena like dirty reads, non-repeatable reads, and phantom reads. The document discusses the speaker's background and certifications. It concludes with an outline of topics to be covered, including locking basics, advanced locking concepts, controlling locking, pessimistic and optimistic concurrency approaches.
This document discusses transactions in SQL and database management systems. It explains that DBMSs use transactions to ensure atomicity, consistency, isolation, and durability when multiple users access and modify data simultaneously. SQL supports transactions through statements like COMMIT, ROLLBACK, and by setting the transaction isolation level. The isolation level determines how transactions interact with each other and see concurrent changes to the database.
The document discusses concurrency and transactions in SQL Server databases. It covers topics such as locking basics, pessimistic and optimistic concurrency models, transaction isolation levels, and preventing issues like dirty reads, non-repeatable reads and phantom reads. The key aspects of transactions discussed are atomicity, consistency, isolation and durability (ACID).
The document discusses different concurrency models like pessimistic and optimistic locking and how they are implemented in SQL Server using locks and row versioning. It also covers isolation levels, lock types like shared, exclusive and intent locks, how locks are escalated, and techniques for resolving blocking issues between transactions.
MariaDB MaxScale: an Intelligent Database ProxyMarkus Mäkelä
MariaDB MaxScale is a database proxy that abstracts database clusters to simplify application development and management. It isolates complexity, provides high availability, and improves performance. MaxScale classifies queries, monitors cluster nodes, routes reads and writes, and hides failures to present a single logical database interface. Key components include intelligent routing, query classification, cluster monitoring, and extensible filtering. It provides a unified way to handle different cluster types and seamlessly handle failures and topology changes.
DIY: A distributed database cluster, or: MySQL ClusterUlf Wendel
Live from the International PHP Conference 2013: MySQL Cluster is a distributed, auto-sharding database offering 99,999% high availability. It runs on Rasperry PI as well as on a cluster of multi-core machines. A 30 node cluster was able to deliver 4.3 billion (not million) read transactions per second in 2012. Take a deeper look into the theory behind all the MySQL replication/clustering solutions (including 3rd party) and learn how they differ.
Replay your workload as it is your actual one! Boris Hristov
Have you ever wanted to replay your application workload be that because you upgraded to a new hardware, added new indexes or something else? Now there's a feature for that! It's called Distributed Replay and in this session you will learn how this new feature in SQL Server 2012 can help you resolve that problem!
SQL Server is able to service requests from a large number of concurrent users. When SQL Server is servicing requests from many clients, there is a strong possibility that conflicts will occur because different processes request access to the same resources at the same time. A conflict in which one process is waiting for another to release a resource is called a block. Although in SQL Server a blocked process usually resolves itself when the first process releases the resource but there are times when a process holds a transaction lock and doesn't release it. In this tip, we will learn different techniques to troubleshoot and resolve blocks in SQL Server.
The document provides an overview of database transactions and transaction management. It discusses what transactions are, their ACID properties (atomicity, consistency, isolation, and durability), concurrency problems that can arise from conflicting transactions, and techniques for concurrency control including locking strategies and dealing with deadlocks.
SQL Server uses different types of locks at varying levels of granularity to control access to resources by transactions. Locking resources at a finer-grained level, like individual rows, increases concurrency but requires more locks. Locking at a coarser level, like entire tables, reduces the number of required locks but also decreases concurrency by restricting access to the entire resource. SQL Server automatically determines the appropriate lock level needed based on the transaction's data access needs.
Database concurrency and transactions - Tal Oliersqlserver.co.il
This document provides an overview of database transactions and locking concepts. It discusses the ACID model which guarantees atomicity, consistency, isolation, and durability. It describes different isolation levels and how they handle phenomena like dirty reads. It also covers locking types including exclusive and share locks. Advanced topics covered include concurrency, lock escalation, and how transactions and locking are implemented differently in Oracle and SQL Server.
DB2 Express-C is a free version of the DB2 database server from IBM. It has no usage or deployment limits and can run on Windows, Linux, Mac OS X, and Solaris operating systems. Minimum requirements are 256MB of RAM but it is recommended to have at least 1GB. DB2 Express-C provides basic database functionality and sits below the paid DB2 Workgroup and Enterprise editions in terms of features. It uses concurrency controls like locking and transactions to allow for multi-user access to the database.
The Nightmare of Locking, Blocking and Isolation LevelsBoris Hristov
I am sure you all know that troubleshooting problems related to locking and blocking (hey, sometimes there are deadlocks too) can be a real nightmare! In this session, you will be able to see and understand why and how locking actually works, what problems it causes and how can we use isolation levels and various other techniques to resolve them!
The document discusses database security. It defines database security as mechanisms that protect databases from intentional or unintentional threats like theft, fraud, loss of confidentiality, integrity, and availability. It discusses various security threats and countermeasures like authorization, views, backups, encryption, and locking. It describes different types of locks like shared and exclusive locks. It also covers authorization, views, backups, integrity controls, encryption, and PL/SQL security features like explicit locking statements.
Troubleshooting Deadlocks in SQL Server 2000elliando dias
The document discusses deadlocks in SQL Server 2000, including:
1. Deadlocking concepts like lock-based and multi-resource deadlocks.
2. Types of lock deadlocks like single-resource conversion deadlocks and multi-resource exclusive or mixed exclusive-shared deadlocks.
3. Gathering deadlock information in SQL Server like error 1205 and identifying blocking and deadlocked processes.
Persistence Is Futile - Implementing Delayed DurabilityMark Broadbent
The concurrency model of most Relational Database Systems are defined by the ACID properties but as they aim for ever increasing transactional throughput, those rules are bent, ignored, or even broken.
In this session, we will investigate how SQL Server implements transactional durability in order to understand how Delayed Durability bends the rules to remove transactional bottlenecks and achieve improved throughput. We will take a look at how this can be used to compliment In-Memory OLTP performance, and how it might impact or compromise other things.
See this session and you will be assimilated!
Abhishek Kumar proposes developing a new locking service, manager, and pluggable interface for CloudStack to enable high availability of the CloudStack database. The new service would use distributed lock managers like ZooKeeper or Hazelcast to allow for multi-master database replication. Currently, CloudStack uses MySQL locks that do not support database clustering solutions. A distributed locking approach would allow the database to be clustered for active-active or active-passive configurations. Abhishek then discusses database locking, distributed locking, ZooKeeper, and Hazelcast as potential implementations and demonstrates a proof of concept using ZooKeeper and Hazelcast before considering future work.
Choosing A Concurrency Model, Optimistic Or PessimisticVinod Kumar
This document discusses concurrency models and transaction handling in SQL Server. It covers optimistic and pessimistic concurrency approaches, and how SQL Server implements transactions using the ACID properties. Key concurrency issues like lost updates, dirty reads, and phantoms are explained. The document also discusses SQL Server's support for ANSI isolation levels and how it implements them using either pessimistic locking or new options like snapshot isolation in SQL Server 2005.
Clustered Architecture Patterns Delivering Scalability And AvailabilityConSanFrancisco123
The document discusses different architecture patterns for delivering scalability and availability in clustered systems. It covers load-balanced and partitioned scale-out patterns, and how to balance simplicity, scalability, and availability. JVM-level clustering is presented as an approach that can address these patterns by sharing memory across JVMs in a transparent way.
This document provides an overview and agenda for a presentation on SQL Server 2012 high availability and disaster recovery capabilities. The presentation covers changes from SQL Server 2008 to 2012 in HA and DR options, including availability groups which allow for database mirroring across multiple servers without shared storage. Licensing changes are also discussed. The objectives are to explain SQL clustering, how it works, and what's new in SQL Server 2012 for HA and DR.
This document provides an overview of managing data and concurrency in Oracle databases. It covers using SQL to manipulate data through INSERT, UPDATE, DELETE, and MERGE commands. It also describes PL/SQL objects like packages, procedures, functions and triggers. Finally, it discusses how to monitor and resolve locking conflicts that can occur from concurrent transactions through detecting and resolving blocking sessions and deadlocks.
Webinar slides: 9 DevOps Tips for Going in Production with Galera Cluster for...Severalnines
This document provides an overview and agenda for a webinar on managing and monitoring MySQL clusters using ClusterControl by Severalnines. The webinar host is introduced and instructions are provided for asking questions. The webinar will cover topics such as operating system configuration, backup strategies, replication, query performance, schema changes, security, reporting, and disaster recovery. Case studies and customers are also briefly mentioned.
Automated scaling of microservice stacks for JavaEE applications - JEEConf 2017Jelastic Multi-Cloud PaaS
Auto scaling of Java EE applications is not that easy task, that is why we decided to help you and highlighted a general concept for Java EE apps with real use cases, issues, and tricky things. Find out how to configure and package clustered Payara Micro with load balancing, automatic scaling and dedicated storage for building cloud-native microservices from this comprehensive presentation by Ihor Kolodyuk (Technical Director at Jelastic) at JEEConf Kyiv 2017.
This document discusses automated scaling of JavaEE microservice stacks. It begins by introducing the speaker and their experience with autoscaling technologies. It then explains that while simple applications can be easily scaled by increasing container replicas, scaling complex JavaEE applications requires more work. The document outlines three key aspects needed for scalable applications: using lightweight application servers adapted for containers; decomposing monolithic applications into independently scalable microservices; and using orchestration software to automate provisioning, health checks, metrics collection, and scaling. It provides examples of scaling strategies for different application components like message queues and databases. It also discusses common issues like ensuring new instances are properly registered for events and services. The document emphasizes that proper configuration of autoscaling triggers
This document discusses transaction management in SQL. It defines a transaction as a logical unit of work that must fully commit or roll back. Transactions ensure data integrity by allowing all or none of a set of SQL statements to apply. The document covers transaction outcomes, the need for transactions, locking, isolation levels, deadlocks, and how to control transactions using SQL statements.
Find out how to configure and package clustered Payara Micro with load balancing, automatic scaling and dedicated storage for building cloud-native microservices. Then with the help of cloud scripting and triggering, automate CI/CD for the deployed application and emulate the load to check the scaling and performance results.
SQL Server is a high performance relational engine and provides a highly scalable database platform but due to its complexity, bad programming practices, poor indexing and configuration can be prone to serious concurrency problems, unexpected behaviors, lost updates and much more! In SQL Server 2005, two optimistic concurrency mechanisms were introduced and touted as the solution to all our problems. Now in SQL Server 2012 and SQL 2014 even more have followed including latch free data-structures, but many challenges and problems still remain. Let’s take a long look into the world of SQL Server concurrency and investigate Pessimistic and Optimistic isolation understanding how they work, when you should use them, and more importantly when they can go very wrong. Don't be staring down the wrong end of SQL Server's two Smoking Barrels and join me for this revealing and thought provoking presentation.
The document discusses querying and managing data using SQL Server 2005. It covers implementing triggers, transactions, and transactional integrity. Triggers are created to perform actions on data modifications. Transactions execute statements as a single logical unit using properties like atomicity and isolation. Locking mechanisms maintain integrity and prevent issues like lost updates when multiple users access the same data.
Similar to Welcome to the nightmare of locking, blocking and isolation levels! (20)
Have you recently been in a boring presentation? I bet you were. I am also almost sure that one of the reason why you got bored is because of the speaker's slide deck. That is true because 99% of the presenters out there use their presentation software(be that PowerPoint, Prezi or Keynote) in a wrong way. This, of course, leads to missed opportunities for future business, disappointed audiences and probably miscommunicated important information. As presenters we want the opposite!
This document provides an overview of business intelligence. It defines business intelligence as transforming data into knowledge. It discusses data warehouses as single points of truth that store large amounts of differently designed data. It demonstrates extracting information from data warehouses using T-SQL and visualizing data in Excel models and Power BI reports to provide ready analytics to managers in a beautiful way.
The 5 Hidden Performance Gems of SQL Server 2014Boris Hristov
SQL Server 2014 comes with dozens of improvements in various areas. In this presentation we will discuss and see how the new release can make the life of each and every developer easier and what are the top 5 T-SQL enhancements that we can use in our day-to-day work.
Do you think that your data is not secured in the cloud? Is that one of the reasons for you to not migrate at least some workloads there? Things changed in the last few months in terms of Azure security. In this session we will take a closer look at what the features Row Level Security(RLS) and Dynamic Data Masking can do for your business and how they can help you secure your databases.
How to Deliver Technical Presentations: The Right Way!Boris Hristov
Have you been to a bad presentation or is it actually you that want to gain and improve your presentation skills? In this session you will learn what makes of a great presentation and what are the mistakes that sometimes even advanced speakers do! You will see and be presented with the most important concepts and techniques that will help you go to the next level and deliver far better presentations for your audience! We will take a look at both the fundamentals and the specifics of a technical presentation and what makes one great!
Do you think that your data is not secured in the cloud? Is that one of the reasons for you to not migrate at least some workloads there? Things changed in the last few months in terms of Azure security. In this session we will take a closer look at what the features Row Level Security(RLS) and Dynamic Data Masking can do for your business and how they can help you secure your databases.
Top 5 T-SQL Improvements in SQL Server 2014Boris Hristov
SQL Server 2014 comes with dozens of improvements in various areas. In this presentation we will discuss and see how the new release can make the life of each and every developer easier and what are the top 5 T-SQL enhancements that we can use in our day-to-day work.
Have you been to a bad presentation or is it actually you that want to gain and improve your presentation skills? In this session you will learn what makes of a great presentation and what are the mistakes that sometimes even advanced speakers do! You will see and be presented with the most important concepts and techniques that will help you go to the next level and deliver far better presentations for your audience! We will take a look at both the fundamentals and the specifics of a technical presentation and what makes one great!
Have you recently been in a boring presentation? I bet you were. I am also almost sure that one of the reason why you got bored is because of the speaker's slide deck. That is true because 99% of the presenters out there use their presentation software(be that PowerPoint, Prezi or Keynote) in a wrong way. This, of course, leads to missed opportunities for future business, disappointed audiences and probably miscommunicated important information. As presenters we want the opposite! In the slide deck you will find 10 of the fundamental rules of great presentation design which we all need to follow in order to join that 1% of people who make a difference and indeed achieve the goals of their presentations.
Top 5 T-SQL Improvements in SQL Server 2014Boris Hristov
SQL Server 2014 comes with dozens of improvements in various areas. In this presentation we will discuss and see how the new release can make the life of each and every developer easier and what are the top 5 T-SQL enhancements that we can use in our day-to-day work.
This document discusses database performance factors for developers. It covers topics like query execution plans, table indexes, table partitioning, and performance troubleshooting. The goal is to help developers understand how to optimize database performance. It provides examples and recommends analyzing execution plans, properly indexing tables, partitioning large tables, and using a structured approach to troubleshooting performance issues.
You want rules? You need Policy-Based Management!Boris Hristov
Have you ever wanted to check, audit or even enforce a specific option or configuration in your environment? What if I tell you that you can accomplish all of these and even report on the results with just a few clicks? Interested? In this session you will learn about the "hidden power" of Policy-Based Management, Centralised Management Server and EPM Framework and how they can help you keep your environment healthy and under control!
This document provides an introduction to Microsoft SQL Server. It discusses why data is important for businesses, how SQL Server helps manage data, and an upcoming hands-on session to learn SQL Server 2014. The document outlines the history and components of SQL Server, editions available, how to install and connect to SQL Server instances, and introduces SQL Server Management Studio as the GUI tool. It concludes with a planned Q&A session.
Top 5 TSQL Improvements in SQL Server 2014Boris Hristov
SQL Server 2014 comes with dozens of improvements in various areas. In this presentation we will discuss and see how the new release can make the life of each and every developer easier and what are the top 5 T-SQL enhancements that we can use in our day-to-day work.
Top 12 AI Technology Trends For 2024.pdfMarrie Morris
Technology has become an irreplaceable component of our daily lives. The role of AI in technology revolutionizes our lives for the betterment of the future. In this article, we will learn about the top 12 AI technology trends for 2024.
The Challenge of Interpretability in Generative AI Models.pdfSara Kroft
Navigating the intricacies of generative AI models reveals a pressing challenge: interpretability. Our blog delves into the complexities of understanding how these advanced models make decisions, shedding light on the mechanisms behind their outputs. Explore the latest research, practical implications, and ethical considerations, as we unravel the opaque processes that drive generative AI. Join us in this insightful journey to demystify the black box of artificial intelligence.
Dive into the complexities of generative AI with our blog on interpretability. Find out why making AI models understandable is key to trust and ethical use and discover current efforts to tackle this big challenge.
Redefining Cybersecurity with AI CapabilitiesPriyanka Aash
In this comprehensive overview of Cisco's latest innovations in cybersecurity, the focus is squarely on resilience and adaptation in the face of evolving threats. The discussion covers the imperative of tackling Mal information, the increasing sophistication of insider attacks, and the expanding attack surfaces in a hybrid work environment. Emphasizing a shift towards integrated platforms over fragmented tools, Cisco introduces its Security Cloud, designed to provide end-to-end visibility and robust protection across user interactions, cloud environments, and breaches. AI emerges as a pivotal tool, from enhancing user experiences to predicting and defending against cyber threats. The blog underscores Cisco's commitment to simplifying security stacks while ensuring efficacy and economic feasibility, making a compelling case for their platform approach in safeguarding digital landscapes.
It's your unstructured data: How to get your GenAI app to production (and spe...Zilliz
So you've successfully built a GenAI app POC for your company -- now comes the hard part: bringing it to production. Aparavi addresses the challenges of AI projects while addressing data privacy and PII. Our Service for RAG helps AI developers and data scientists to scale their app to 1000s to millions of users using corporate unstructured data. Aparavi’s AI Data Loader cleans, prepares and then loads only the relevant unstructured data for each AI project/app, enabling you to operationalize the creation of GenAI apps easily and accurately while giving you the time to focus on what you really want to do - building a great AI application with useful and relevant context. All within your environment and never having to share private corporate data with anyone - not even Aparavi.
Choosing the Best Outlook OST to PST Converter: Key Features and Considerationswebbyacad software
When looking for a good software utility to convert Outlook OST files to PST format, it is important to find one that is easy to use and has useful features. WebbyAcad OST to PST Converter Tool is a great choice because it is simple to use for anyone, whether you are tech-savvy or not. It can smoothly change your files to PST while keeping all your data safe and secure. Plus, it can handle large amounts of data and convert multiple files at once, which can save you a lot of time. It even comes with 24*7 technical support assistance and a free trial, so you can try it out before making a decision. Whether you need to recover, move, or back up your data, Webbyacad OST to PST Converter is a reliable option that gives you all the support you need to manage your Outlook data effectively.
Keynote : AI & Future Of Offensive SecurityPriyanka Aash
In the presentation, the focus is on the transformative impact of artificial intelligence (AI) in cybersecurity, particularly in the context of malware generation and adversarial attacks. AI promises to revolutionize the field by enabling scalable solutions to historically challenging problems such as continuous threat simulation, autonomous attack path generation, and the creation of sophisticated attack payloads. The discussions underscore how AI-powered tools like AI-based penetration testing can outpace traditional methods, enhancing security posture by efficiently identifying and mitigating vulnerabilities across complex attack surfaces. The use of AI in red teaming further amplifies these capabilities, allowing organizations to validate security controls effectively against diverse adversarial scenarios. These advancements not only streamline testing processes but also bolster defense strategies, ensuring readiness against evolving cyber threats.
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...Fwdays
.NET 8 brought a lot of improvements for developers and maturity to the Azure serverless container ecosystem. So, this talk will cover these changes and explain how you can apply them to your projects. Another reason for this talk is the re-invention of Serverless from a DevOps perspective as a Platform Engineering trend with Backstage and the recent Radius project from Microsoft. So now is the perfect time to look at developer productivity tooling and serverless apps from Microsoft's perspective.
Cracking AI Black Box - Strategies for Customer-centric Enterprise ExcellenceQuentin Reul
The democratization of Generative AI is ushering in a new era of innovation for enterprises. Discover how you can harness this powerful technology to deliver unparalleled customer value and securing a formidable competitive advantage in today's competitive market. In this session, you will learn how to:
- Identify high-impact customer needs with precision
- Harness the power of large language models to address specific customer needs effectively
- Implement AI responsibly to build trust and foster strong customer relationships
Whether you're at the early stages of your AI journey or looking to optimize existing initiatives, this session will provide you with actionable insights and strategies needed to leverage AI as a powerful catalyst for customer-driven enterprise success.
Demystifying Neural Networks And Building Cybersecurity ApplicationsPriyanka Aash
In today's rapidly evolving technological landscape, Artificial Neural Networks (ANNs) have emerged as a cornerstone of artificial intelligence, revolutionizing various fields including cybersecurity. Inspired by the intricacies of the human brain, ANNs have a rich history and a complex structure that enables them to learn and make decisions. This blog aims to unravel the mysteries of neural networks, explore their mathematical foundations, and demonstrate their practical applications, particularly in building robust malware detection systems using Convolutional Neural Networks (CNNs).
UiPath Community Day Amsterdam: Code, Collaborate, ConnectUiPathCommunity
Welcome to our third live UiPath Community Day Amsterdam! Come join us for a half-day of networking and UiPath Platform deep-dives, for devs and non-devs alike, in the middle of summer ☀.
📕 Agenda:
12:30 Welcome Coffee/Light Lunch ☕
13:00 Event opening speech
Ebert Knol, Managing Partner, Tacstone Technology
Jonathan Smith, UiPath MVP, RPA Lead, Ciphix
Cristina Vidu, Senior Marketing Manager, UiPath Community EMEA
Dion Mes, Principal Sales Engineer, UiPath
13:15 ASML: RPA as Tactical Automation
Tactical robotic process automation for solving short-term challenges, while establishing standard and re-usable interfaces that fit IT's long-term goals and objectives.
Yannic Suurmeijer, System Architect, ASML
13:30 PostNL: an insight into RPA at PostNL
Showcasing the solutions our automations have provided, the challenges we’ve faced, and the best practices we’ve developed to support our logistics operations.
Leonard Renne, RPA Developer, PostNL
13:45 Break (30')
14:15 Breakout Sessions: Round 1
Modern Document Understanding in the cloud platform: AI-driven UiPath Document Understanding
Mike Bos, Senior Automation Developer, Tacstone Technology
Process Orchestration: scale up and have your Robots work in harmony
Jon Smith, UiPath MVP, RPA Lead, Ciphix
UiPath Integration Service: connect applications, leverage prebuilt connectors, and set up customer connectors
Johans Brink, CTO, MvR digital workforce
15:00 Breakout Sessions: Round 2
Automation, and GenAI: practical use cases for value generation
Thomas Janssen, UiPath MVP, Senior Automation Developer, Automation Heroes
Human in the Loop/Action Center
Dion Mes, Principal Sales Engineer @UiPath
Improving development with coded workflows
Idris Janszen, Technical Consultant, Ilionx
15:45 End remarks
16:00 Community fun games, sharing knowledge, drinks, and bites 🍻
UiPath Community Day Amsterdam: Code, Collaborate, Connect
Welcome to the nightmare of locking, blocking and isolation levels!
1. Българска SQL & BI
потребителска група
http://bgsqlgroup.com SQL & BI User Group Bulgaria on FB
2. WELCOME TO THE NIGHTMARE OF
LOCKING, BLOCKING
AND ISOLATION LEVELS!
Magi Naumova
Boris Hristov
BG SQL User Group Meeting,
4/4/2013
3. About Magi
Working with SQL Server from v6.5
MCT from 1998
SQL Server Trainer and Consultant for more than 15 years, having
more over 100 projects in Bulgaria, Finland, Germany, UK, Greece..
5 years Senior Consultant in Microsoft
Microsoft Certified Master SQL Server 2008
MVP SQL Server
SolidQ Mentor & Trainer
Now I am running SQL Master Academy training program
www.SQLMasterAcademy.com
4. About Bobi
SQL Server DBA at HP
Trainer at New Bulgarian University and FMI
MCT & MCITP DBA SQL Server 2008
brshristov@live.com
www.borishristov.com
5. Agenda…
Transactions. What are they?
Locks. What is there for us?
Troubleshooting locking problems
Transaction Isolation Levels
7. What Are Transactions?
A transaction is an Atomic unit of work
A transaction leaves data in a Consistent
state
A transaction is Isolated from other
concurrent transactions
A transaction is Durable
8. Auto Commit Transactions
Default transaction mode
Every TSQL statement is committed or rolled back on completion
Compile errors result in entire batch not being executed
Run time errors may allow part of the batch to commit
---run time error
-- compile error - partially executed
USE AdventureWorks2012;
GO
CREATE TABLE TestBatch (Cola INT PRIMARY KEY, Colb CHAR(3));
GO
INSERT INTO TestBatch VALUES (1, 'aaa');
INSERT INTO TestBatch VALUES (2, 'bbb');
INSERT INTO TestBatch VALUSE (3, 'ccc'); ---Duplicate key error.
VALUES (1, -- error, error!
GO
SELECT * FROM TestBatch; -- Returns no rows. 2.
rows 1 and
GO
9. Implicit Transactions
SQL Server is responsible for opening the transaction
We are responsible for committing or rolling it back
Can be turned on from Connections tab in Server Properties
SET IMPLICIT_TRANSACTIONS ON SET IMPLICIT_TRANSACTIONS ON
USE AdventureWorks2012 USE AdventureWorks2012
GO GO
UPDATE [Person].[Address] UPDATE [Person].[Address]
SET AddressLine1='Microsoft, Bulgaria' SET AddressLine1='Microsoft, Bulgaria'
WHERE AddressID=2 WHERE AddressID=2
COMMIT – this will write a change to the db ROLLBACK – this will not write a change to the d
10. Explicit Transactions
A transaction in which start and end of transaction is explicitly declared
BEGIN TRANSACTION
COMMIT TRANSACTION OR ROLLBACK TRANSACTION
XACT_ABORT ON/OFF – control the rollback behavior
SET XACT_ABORT ON – if run time error is generated everything is rolled back
USE AdventureWorks2012
GO
BEGIN TRANSACTION FundsTransfer
GO
EXEC HumanResources.DebitAccount '100', 'account1';
EXEC HumanResources.CreditAccount '100', 'account2';
COMMIT TRANSACTION;
12. Methods of Concurrency Control
Two main concurrency control types:
1. Pessimistic – SQL Server uses locks, causes blocks and who said
deadlocks?
2. Optimistic
2. Optimistic – SQL Server generates versions for everyone, but the
updates…
13. What Are Locks and what is locking?
Lock – internal memory structure that “tells” us what we all do with the
resources inside the system
Locking – mechanism to protect the resources and guarantee consistent data
14. Common lock types
Shared (S) Update (U)
Used for: Reading Used for: Preparing to modify
Duration: Released almost immediately Duration: End of the transaction or until
(depends on the isolation level) converted to exclusive (X)
Exclusive (X) Intent
Used for: Modifying Used for: Preventing incompatible
Duration: End of the transaction locks
Duration: End of the transaction
15. Lock Compatibility
Not all locks are compatible with other locks.
Lock Shared Update Exclusive
Shared (S)
X
Update (U)
X X
Exclusive
(X)
X X X
17. Let’s update a row. What do we need?
S
A query!
IX
USE AdventureWorks2012
GO
UPDATE [Person].[Address]
SET AddressLine1='Microsoft, Bulgaria' Header IX
WHERE AddressID=2
Row
Row
Row
Row X
Row
18. Methods to View Locking Information
Dynamic SQL Server Performance
Management Profiler or monitor or Activity
Views Extended Monitor
Events
20. Locking and blocking
Locking and blocking are often confused!
Locking
• The action of taking and potentially holding locks
• Used to implement concurrency control
Blocking is result of locking!
• One process needs to wait for another process to release locked resources
• In a multiuser environment, there is always, always blocking!
• Only a problem if it lasts too long
21. Lock granularity and escalation
SQL Server decides (during compilation) the granularity of locks to be used:
• Row
• Page
Lock granularity can be controlled via LOCK HINTS (PAGLOCK, TABLOCKX,
etc…)
Escalation always happens this way:
Row -> table lock (or partition lock if possible)
Page -> table lock (or partition lock if possible)
Lock escalation can be disabled:
• Trace flag 1211 – disables lock escalation on server level
• Trace flag 1224 – disables lock escalation on server level until 40% of the memory
used is consumed
23. Controlling Lock escalation
Switch the escalation level (per table)
SELECT lock_escalation_desc
FROM sys.tables
WHERE name = 'Person.Address'
ALTER TABLE Person.Address SET (LOCK_ESCALATION = {AUTO |
TABLE | DISABLE)
AUTO – Partition-level escalation if the table is partitioned
TABLE – Always table-level escalation
DISABLE – Do not escalate until absolutely necessary
24. Lock Duration
SET LOCK_TIMEOUT 5000
SET LOCK_TIMEOUT specifies number
of milliseconds to wait BEGIN TRAN
Default LOCK_TIMEOUT is -1 = wait
indefinitely UPDATE
Production.ProductInventory
Session level option SET Quantity = 500
WHERE ProductID = 1;
When timeout expires, error 1222 is
returned -- what happens if the update
times out?
Not a good idea to be used!
Does not resolve blocking problems! DELETE FROM
Production.ProductModel
WHERE Name LIKE 'Mountain%';
COMMIT
25. Blocking a.k.a live locking
Blocking occurs because of locked resources
First incompatible lock request waits
All other locks requests (even if compatible) WAIT
How to resolve blocking problems:
1. Keep the transactions as short as possible
2. No user interactions required in the middle of the transaction
3. Reduce row by row operations (cursors)
4. Use indexes
5. Consider a server to offload some of the workloads
5. Choose isolation level
26. What Are Deadlocks?
Who is victim?
• Cost for Rollback
• Deadlock priority – SET DEADLOCK_PRIOIRTY
Task A Resource 1
Task B
Resource 2
27. DEMO
Capturing locking information
Who is blocking who
Lock escalation – both to table and partition
Deadlock and the SET DEADLOCK_PRIORITY option
29. Pessimistic Isolation Levels
Changing Isolation level
◦ SET TRANSACTION ISOLATION LEVEL ….. on session level
eXclusive lock
Transaction 1
Read
Update
Select
Uncommitted
Transaction 2
Lowering the default Read Committed
◦ NOLOCK hint – set on the table level
◦ SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
You have Dirty Reads in this isolation level! Saying you want less blocking at the cost of inconsistent data!
If you need to use it a lot, that means, you need a reporting database (or optimistic locking)
30. Pessimistic Isolation Levels
Increasing the default level to Repeatable Read
Repeatable
Transaction 1 S(hared) lock
Read
select Transaction 2
Update
S lock is held until the end of the transaction in order to read the same data
Every transaction that has to update rows has to wait until T1 completes
Inserts (phantoms) performed by another transaction can still occur in the table
31. Pessimistic Isolation Levels
Increasing to Serializable
Transaction 1 S(hared) lock
Serializable
select
Transaction 2
Insert
Repeatable Read + Holding the locks for a zone of rows
If there is no index (or not used) the whole tale will be locked
Highest level of isolation, lowest level of concurrency
Be careful with using Frameworks (EF, LYNC)
33. Optimistic Concurrency
Based on Row versioning
◦ When updating a row, the previous version is stored in the version store
◦ The new row contains a pointer to the old row in the version store
Transaction 1
V1 V2
Select
Transaction 2
Readers do not block writers and writers do not block readers.
BUT writers can and will block writers, this can cause conflicts.
Adds 14bytes to every row
Needs Version Store i.e. TempDB space
34. Implementation – RCSI and SI
RCSI
◦ Statement-Level versioning, i.e. any query sees the last version of data as of the beginning of the statement
◦ Requires ALTER ATABASE SET READ_COMMITTED_SNAPSHOT ON
Transaction 1
V1 V2
Select Select in RCSI
Transaction 2 Select in SI
Snapshot Isolation Level
◦ Session Level versioning, i.e. the most recent committed version of the rows as of the beginning of the transaction
◦ Requires ALTER DATABASE SET ALLOW_SNAPSHOT_ISOLATION ON
◦ Requires SET TRANSACTION ISOLATION LEVEL SNAPSHOT
◦ If used then better together with RCSI! Else, you have drawbacks of versioning only!
36. Managing Version store
The Version Store
◦ SQL Server starts generating versions in tempdb as soon as a database is enabled for one of the
snapshot-based isolation levels
◦ Maintains link lists of rows, the end of the list is the oldest version of that particular row
Managing Version Store
◦ SQL Server maintains a clean-up thread
◦ If file cannot grow, a snapshot query fails (tempdb growth errors)
◦ Monitoring counters
◦ Free Space in tempdb
◦ Version Store Size
◦ Version Generation Rate and Version Cleanup Rate
◦ Longest Transaction Running Time
◦ Snapshot Transactions
38. Summary
If you experience blocking consider implementing Optimistic Concurrency
Consider RCSI only, it is way cheeper
RCSI + SI only if needed higher isolation level per transaction (RR in pesimistic)
If you have to use often no blocking hints the consider either reporting DB or optimistic
concurrency
Be careful with READPAST, NOLOCK, ….LOCK TIMEOUT and any other work arounds
If you keep default concurrency, then follow the recommendations for minimizing blocking and
lock escalations
Be careful with hidden hints/isolation levels changes using EF, LYNC, etc
39. Resources
MCM Readiness videos on locking lecture and demo
MCM Readiness video on Snapshot Isolation Level
http://blogs.msdn.com/b/bartd/archive/tags/sql+lockin
g/
http://www.sqlskills.com/blogs/paul/category/locking/
Lock hints -
http://www.techrepublic.com/article/control-sql-server-
locking-with-hints/5181472
Когато започнах се надявах да отида на безплатен ивент на подобна тема за това, за да мога да я разбера по – добре, а сега имам щастието самия аз да ви дам моите знания. Наистина е леко по – специална за мен и има огромна стойност Та...
Atomic – Error handling and how we use itConsistent – Foreign keys, check constraints, triggers, validation rules.Isolated – locking, isolation levelsDurable – transaction log – rolling back and forward
Every Transact-SQL statement is committed or rolled back when it completes. If a statement completes successfully, it is committed; if it encounters any error, it is rolled back.
Mention try - catch
You use locking, because you do not like the fact that someone can change the data you are reading at the momentOptimistic – versionsКонтрол на достъпа
How much memory is used – locks on server level (decommissioned)Up to 60% of the buffer pool – out of lock memory errorsIn startup (with 0 option) it allocates 2500 locks. 2%LOCK BLOCK Lock Owner block64 bytes – 32 bit system 32 bytes – 32 bit 128 bytes – 64 bit system 64 bytes – 64 bit
Обясни какво се случва – как се минава от SUXИнтент лок – нужни са, защото SQL Server може да хваща локове на много различни обекти. Ако някой процес иска да локне таблицата, все пак трябва да има начин да му се каже, че някой ъпдейтва стойности в нея, нали?
Обясни какво се случва – как се минава от SUX+ Shared <- Exclusive <- SharedSIX - convert lock. Example – shared lock on a row now has to become X lock. However, for the exclusive to occur, we ed IX in the upper levels – that is the moment when we convert our S and IS locks to X and SIX locks
Всяка една транзакция преминава от тук. Обяснение защо.
Why do we need Shared locks – to explain it to the audienceWhy do we need intend locks and what is their goal? Why are they helping us?
Този слайд трябва да е последен в секцията introduction to locksDynamic Management ViewsSystem stored proceduresSQL ProfilerPerformance Monitor countersBlocked Process ReportDeadlock events and trace flag 1222SQL Server 2008 addsPerformance Data CollectionExtended Events
Not exactly – it always decides during compilation ROW or PAGE level – tow options only (when standard DML operations, not altering object)After that it could escalate to partition/table level
Memory takes memory 60…. InternalsEscalating in case of 40% of the memory used for locks Or 5000 locks on one objectIf escalation fails because of incompatible lock – sql server waits for another 1250 locks Always to table(partitioning) – auto to partition from 2008What is the solution?
Should be VERY VERY Careful when choosing to control it manually!! Could easy cause more problems, and it is rarely used as a lock escalation solution nor as a resolution of blocking problems! Could be set in specific cases only
The READPAST query hintERROR HANDLING for error 1222!
Blocking what is that, when does it happen, reasons behind (holding locks because of long running user trans (examples), long running trans because of resource usage problems (IO waits..), lock escalations because of row by row operations (examples), how to identify/ how to isolate reasons behindКонтекст: by default – pesimistic, read committed
Threads are killedLOCK_MONITOR checks every 5 seconds for deadlock. Cycle and conversion deadlocksError 1205 should be handled Some operations cannot be chosen for deadlock victims (rollbacks)After the deadlock occurs, the engine still continues to work and check every so often (100 ms) for other deadlocks
Shortly:isolation level RU, Isolation level RRReadpast - difference between READPAST, READUNCOMMITTED,and setting LOCK_TIMEOUT to 0. All these techniques let you avoid blocking problems,but the behavior is slightly different in each caseSerializable with Table lockDiagnose and recognize:Adam Machanic'ssp_WhoIsActive @get_additional_info = 1 will give you the isolation level, and I've used that for quick diagnostics to find out who's doing dirty reads. Just good for a first pass though.+ Aaron’s script: http://www.mssqltips.com/sqlservertip/2475/sql-server-queries-with-hints/