\begin{frame}
\frametitle{Example: ATM Transaction}
To comply with the 2PL, the ATM transaction
\alert{must not acquire new locks after a lock has been released}.
\bigskip
\begin{exampleblock}{ATM withdrawal with 2 Phase Locking}
\nr{1} \textcolor{dgreen}{$\fun{xlock}(\var{account})$}\\
\nr{2} $\var{balance} \set \fun{read}(\var{account})$\\
\nr{3} $\var{balance} \set \var{balance}-100$\\
\nr{4} $\fun{write}(\var{account},\var{balance})$\\
\nr{5} \textcolor{dgreen}{$\fun{unlock}(\var{account})$}
\end{exampleblock}
\end{frame}