\begin{frame} \frametitle{Pessimistic: Lock-based Concurrency Control} \begin{goal}{Lock-based concurrency control} Transactions must \emph{lock} objects before using them. \end{goal} \pause\medskip \begin{block}{Types of \emph{locks}} \begin{itemize} \item \emph{Shared lock (S-lock)} is acquired on Y before reading Y.\\[1ex] Many transactions can hold a shared lock on Y. \medskip \item \emph{Exclusive lock (X-lock)} is acquired on Y before writing Y.\\[1ex] A transaction can hold an exclusive lock on Y only if no other transaction holds any lock on Y. \end{itemize} \end{block} \smallskip If a transaction has an X-lock on Y it can also read Y. \end{frame}