File and Record Locking

Slides:



Advertisements
Similar presentations
Concurrency Control WXES 2103 Database. Content Concurrency Problems Concurrency Control Concurrency Control Approaches.
Advertisements

Data and Database Administration Chapter 12. Outline What is Concurrency Control? Background Serializability  Locking mechanisms.
Adapted from: ©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Fly-over Introduction Purpose of Database Systems View of Data Data.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Database Administration Chapter Six DAVID M. KROENKE’S DATABASE CONCEPTS, 2 nd Edition.
Transaction Management and Concurrency Control
Data Definition Language (DDL) Specification notation for defining the database schema –E.g. create table account ( account-number char(10), balance integer)
1 Transaction Management Database recovery Concurrency control.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Database Management Systems Purpose of Database Systems View of Data.
9 Chapter 9 Transaction Management and Concurrency Control Hachim Haddouti.
Database Administration Part 1 Chapter Six CSCI260 Database Applications.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Dr. Kalpakis CMSC 461, Database Management Systems Introduction.
ADVANCED DATABASES WITH ORACLE 11g FOR ADDB7311 LEARNING UNIT 1 of 7.
Introduction to Databases
 Introduction Introduction  Purpose of Database SystemsPurpose of Database Systems  Levels of Abstraction Levels of Abstraction  Instances and Schemas.
Multi-user Database Processing Architectures Architectures Transactions Transactions Security Security Administration Administration.
1 Transactions BUAD/American University Transactions.
Security, Transactions, and Views. Security Achieved through GRANT & REVOKE Assumes the database can recognize its users and verify their identity can.
What is a database? Example of database application: –Banks, –Hospital, –etc Extensions: –Multimedia databases –Geographic Information Systems –Data warehouse.
I Information Systems Technology Ross Malaga 4 "Part I Understanding Information Systems Technology" Copyright © 2005 Prentice Hall, Inc. 4-1 DATABASE.
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Security, Transactions, and Views. About Security As is the case in most shared environments, the DBMS also must implement a security mechanism that allows.
© 2002 by Prentice Hall 1 Database Administration David M. Kroenke Database Concepts 1e Chapter 6 6.
ADVANTAGES OF DATA BASE MANAGEMENT SYSTEM. TO BE DICUSSED... Advantages of Database Management System  Controlling Data RedundancyControlling Data Redundancy.
Why do we need a database?
Managing Multi-User Databases. Mutli-User Issues n Concurrency Control n Database Reliability n Database Security n Database Administration.
3 Database Systems: Design, Implementation, and Management CHAPTER 9 Transaction Management and Concurrency Control.
©Silberschatz, Korth and Sudarshan 1.1 Database System Concepts قواعد البيانات Data Base قواعد البيانات CCS 402 Mr. Nedal hayajneh E- mail
CSCI-235 Micro-Computers in Science Databases. Database Concepts Data is any unorganized text, graphics, sounds, or videos A database is a collection.
SYSTEMS IMPLEMENTATION TECHNIQUES TRANSACTION PROCESSING DATABASE RECOVERY DATABASE SECURITY CONCURRENCY CONTROL.
What is Database Administration ?
Introduction to DBMS Purpose of Database Systems View of Data
I Wanted To Order This Book
Concurrency control.
DBMS & TPS Barbara Russell MBA 624.
Managing Multi-User Databases
Transaction Management
Concurrency Control Managing Hierarchies of Database Elements (18.6)
Unit 1: INTRODUCTION Database system, Characteristics Database Users
Introduction to Databases Ashima wadhwa
Transaction Management and Concurrency Control
Chapter 1: Introduction
Objectives of DBMS Ashima Wadhwa
Introduction to Database Systems
Basic Concepts in Data Management
1 From a client restaurant a representative will pick up a signed order sheet from the restaurant manager for the quantities desired of each item sold.
Concurrency.
Concurrency Control WXES 2103 Database.
1 From a client restaurant a representative will pick up a signed order sheet from the restaurant manager for the quantities desired of each item sold.
Introduction to DBMS Purpose of Database Systems View of Data
1 From a client restaurant a representative will pick up a signed order sheet from the restaurant manager for the quantities desired of each item sold.
Database Security Transactions
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Database Administration
Chapter 1: Introduction
1 From a client restaurant a representative will pick up a signed order sheet from the restaurant manager for the quantities desired of each item sold.
Chapter 1: Introduction
Chapter 11 Managing Databases with SQL Server 2000
DATABASE TECHNOLOGIES
Chapter 1: Introduction
Granularity of Locks and Degrees of Consistency in a Shared Data Base Part II: The Paper Strikes Back By Kyle Imrie.
DBMS Module III DBMS
Terms: Data: Database: Database Management System: INTRODUCTION
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
Chapter 1: Introduction
Views Base Relation View
Transactions-Concurrency Problems
Presentation transcript:

File and Record Locking

Differences between a database management system and a file-processing system A database management system coordinates both the physical and the logical access to the data, whereas a file-processing system coordinates only the physical access. A dbms reduces the amount of data duplication by ensuring that a physical piece of data is available to all programs authorized to have access to it, >whereas data written by one program in a file-processing system may not be readable by another program. • A database management system is designed to allow flexible access to data (i.e., queries), whereas a file-processing system is designed to allow predetermined access to data (i.e., compiled programs).

Differences between a database management system and a file-processing system A database management system is designed to coordinate multiple users accessing the same data at the same time(concurrency). >A file-processing system is usually designed to allow one or more programs to access different data files at the same time. >In a file-processing system, a file can be accessed by two programs concurrently only if both programs have read-only access to the file.

File Locking File locking is a mechanism that restricts access to a computer file by allowing only one user or process access at any specific time.

File Locking Process A reads a customer record from a file containing account information, including the customer's account balance and phone number. Process B now reads the same record from the same file so it has its own copy. Process A changes the account balance in its copy of the customer record and writes the record back to the file. Process B, which still has the original stale value for the account balance in its copy of the customer record, updates the account balance and writes the customer record back to the file. Process B has now written its stale account-balance value to the file, causing the changes made by process A to be lost.

Record locking Record locking is the technique of preventing simultaneous access to data in a database, to prevent inconsistent results

Record locking The classic example is demonstrated by two bank clerks attempting to update the same bank account for two different transactions. Clerks 1 and 2 both retrieve (i.e., copy) the account's record. Clerk 1 applies and saves a transaction. Clerk 2 applies a different transaction to his saved copy, and saves the result, based on the original record and his changes, overwriting the transaction entered by clerk 1. The record no longer reflects the first transaction, as if it had never taken place.

Use of locks Use of locks Record locks need to be managed between the entities requesting the records such that no entity is given too much service via successive grants, and no other entity is effectively locked out. The application or system should be designed such that any lock is held for the shortest time possible

Lock Request Exclusive locks Exclusive locks are, as the name implies, exclusively held by a single entity, usually for the purpose of writing to the record. Shared locks Shared locks differ from exclusive locks in that the holder list can contain multiple entries. If lock requests for the same entity are queued, then once a shared lock is granted, any queued shared locks may also be granted.