188/212
\begin{frame}
  \frametitle{Optimistic Concurrency Control: Validation}

  \vspace{-.5ex}
  \begin{goal}{}
    Validation is typically implemented by maintaining:
    \begin{itemize}
      \item a \emph{read set RS($T_k$)} (attributes read by $T_k$), and
      \item a \emph{write set WS($T_k$)} (attributes written by $T_k$)
    \end{itemize}
    for every transaction $T_k$.
  \end{goal}  
  \pause
  
  \begin{block}{Backward-oriented optimistic concurrency control (BOCC)}
    On commit, compare $T_k$ against all \emph{committed} transactions $T_i$.\\
    Check \emph{succeeds} if
    \begin{tcenter}
      $T_i$ committed before $T_k$ started \;\;\emph{or}\;\; RS($T_k$) $\cap$ WS($T_i$) = $\varnothing$
    \end{tcenter}
    If the check fails, abort $T_k$. 
  \end{block}
  \pause

  \begin{block}{Forward-oriented optimistic concurrency control (FOCC)}
    On commit, compare $T_k$ against all \emph{running} transactions $T_i$.\\
    Check \emph{succeeds} if
    \begin{tcenter}
      WS($T_k$) $\cap$ RS($T_i$) = $\varnothing$
    \end{tcenter}
    If the check fails, abort $T_k$ or $T_i$. 
  \end{block}
\end{frame}