\begin{frame}
\frametitle{Intention Locks}
\begin{goal}{Multi-granularity Locking Protocol}
\begin{itemize}
\item Before a granule $g$ can be locked in S (or X) mode,\\
the transaction has to obtain an IS (or IX) lock\\
on \emph{all coarser} granularities that contain $g$.
\item After all intention locks are granted, the transaction can lock g in the announced mode.
\end{itemize}
\end{goal}
\pause
\begin{exampleblock}{}
The query $Q_1$ would for example:
\begin{itemize}
\item obtain an \emph{IS lock} on the \emph{database}
\item obtain an \emph{IS lock} on the \emph{table} \sql{Customers}
\end{itemize}
Afterwards obtain an \emph{S lock} on the \emph{row} with \sql{id = 42}.
\end{exampleblock}
\pause
\begin{exampleblock}{}
The query $Q_2$ would for example:
\begin{itemize}
\item obtain an \emph{IS lock} on the \emph{database}
\end{itemize}
Afterwards obtain an \emph{S lock} on the \emph{table} \sql{Customers}.
\end{exampleblock}
\end{frame}