public static function beginTransaction()
    {
        if (static::inTransaction()) {
            throw new PDOException();
        }

        static::inTransaction(true);

        $transaction = static::makeTransaction(static::countTransactions());

        static::addTransaction($transaction);
    }