l23_ppt_ivsem
TRANSCRIPT
-
8/18/2019 L23_PPT_IVSem
1/12
LectureLecture- - 2323
Concurrency ControlConcurrency Control
-
8/18/2019 L23_PPT_IVSem
2/12
ContentsContents
Introduction
Concurrency Control vs. Serializability Tests
ea eve s o ons stency
Transaction Definition in SQL
Locking Schemes
Applications
Scope of Research
-
8/18/2019 L23_PPT_IVSem
3/12
IntroductionIntroduction
A database must provide a mechanism that will ensure that all possibleschedules are
,
are recoverable and preferably cascadeless A policy in which only one transaction can execute at a time generates
,
Are serial schedules recoverable/cascadeless?
Testing a schedule for serializability after it has executed is a little tooa e
Goal – to develop concurrency control protocols that will assureserializability.
-
8/18/2019 L23_PPT_IVSem
4/12
Concurrency Control vs. Serializability TestsConcurrency Control vs. Serializability Tests
Concurrency-control protocols allow concurrent schedules, but ensure,
and cascadeless .Concurrency control protocols generally do not examine the
recedence ra h as it is bein created
Instead a protocol imposes a discipline that avoids nonseralizableschedules.
.
Different concurrency control protocols provide different tradeoffsbetween the amount of concurrency they allow and the amount ofoverhead that the incur.
Tests for serializability help us understand why a concurrency controlprotocol is correct.
-
8/18/2019 L23_PPT_IVSem
5/12
Weak Levels of ConsistencyWeak Levels of Consistency
Some applications are willing to live with weak levels of consistency,allowing schedules that are not serializable
-. .
balance of all accountsE.g. database statistics computed for query optimization can bea roximate wh ?
Such transactions need not be serializable with respect to othertransactions
-
8/18/2019 L23_PPT_IVSem
6/12
Transaction Definition in SQLTransaction Definition in SQL
Data manipulation language must include a construct forspecifying the set of actions that comprise a transaction.
, .
A transaction in SQL ends by:Commit work commits current transaction and begins a new
.
Rollback work causes current transaction to abort.
In almost all database systems, by default, every SQL statementa so comm s mp c y execu es success u y
Implicit commit can be turned off by a database directive
E.g. in JDBC, connection.setAutoCommit(false);
-
8/18/2019 L23_PPT_IVSem
7/12
Implementation of IsolationImplementation of Isolation
Schedules must be conflict or view serializable, and recoverable,for the sake of database consistency, and preferably cascadeless.
generates serial schedules, but provides a poor degree ofconcurrency.
Concurrenc -control schemes tradeoff between the amount of concurrency they allow and the amount of overhead that theyincur.
Some schemes allow only conflict-serializable schedules to begenerated, while others allow view-serializable schedules that arenot conflict-serializable.
-
8/18/2019 L23_PPT_IVSem
8/12
-
8/18/2019 L23_PPT_IVSem
9/12
Exclusive LockExclusive Lock
.
of this lock is to provide exclusive use of the data item to onetransaction. If a transaction T locks a data item Q in an exclusivemode no other transaction can access Q until the lock is released bytransaction T.
-
8/18/2019 L23_PPT_IVSem
10/12
Shared LockShared Lock
.
locking is to ensure that the data item does not undergo anymodifications while it is locked in this mode. Any number of transactions can concurrently lack and access a data item in theshared mode, but none of these transactions can modify the dataitem. A data item locked in a shared mode can not be locked in the
exclusive mode until the shared lock is released by all transactions.
-
8/18/2019 L23_PPT_IVSem
11/12
Applications Applications
Concurrency control in data bases is used to avoid the problems of dead locks as this is one of the serious problems in data basemanagement systems
-
8/18/2019 L23_PPT_IVSem
12/12
ScopeScope of Researchof Research
so a on requ remen s n concurrency con ro
Thread safety for concurrent clients
Concurrenc control in distributed database s stems
Realization of Transaction Concurrency Control in Grid
Database