public function transactional(callable $fn)
    {
        $pdo = $this->getPdo();
        $pdo->beginTransaction();
        try {
            call_user_func($fn);
            $pdo->commit();
        } catch (\Exception $e) {
            $pdo->rollBack();
            throw $e;
        }
    }