code: public void beginTransaction(int transactionMode,
              SQLiteTransactionListener transactionListener, int connectionFlags,
              CancellationSignal cancellationSignal) {
          throwIfTransactionMarkedSuccessful();
          beginTransactionUnchecked(transactionMode, transactionListener, connectionFlags,
                  cancellationSignal);
      }
docs: Begins a transaction.
  <p>
  Transactions may nest.  If the transaction is not in progress,
  then a database connection is obtained and a new transaction is started.
  Otherwise, a nested transaction is started.
  </p><p>
  Each call to {@link #beginTransaction} must be matched exactly by a call
  to {@link #endTransaction}.  To mark a transaction as successful,
  call {@link #setTransactionSuccessful} before calling {@link #endTransaction}.
  If the transaction is not successful, or if any of its nested
  transactions were not successful, then the entire transaction will
  be rolled back when the outermost transaction is ended.
  </p>
  
  @param transactionMode The transaction mode.  One of: {@link #TRANSACTION_MODE_DEFERRED},
  {@link #TRANSACTION_MODE_IMMEDIATE}, or {@link #TRANSACTION_MODE_EXCLUSIVE}.
  Ignored when creating a nested transaction.
  @param transactionListener The transaction listener, or null if none.
  @param connectionFlags The connection flags to use if a connection must be
  acquired by this operation.  Refer to {@link SQLiteConnectionPool}.
  @param cancellationSignal A signal to cancel the operation in progress, or null if none.
  
  @throws IllegalStateException if {@link #setTransactionSuccessful} has already been
  called for the current transaction.
  @throws SQLiteException if an error occurs.
  @throws OperationCanceledException if the operation was canceled.
  
  @see #setTransactionSuccessful
  @see #yieldTransaction
  @see #endTransaction