End the transaction by performing findById using spring boot and myBatis

Viewed 137

I think it is bad practice, but I would like to know your reasons why it is.

    @Transactional
    public Person update(Person person, Person updated) {
        personMapper.update(updated);
        phoneService.update(person.getPhones(), updated.getPhones());

        return findById(person.getId());
    }

Is it okay to do a findById inside a method with the @Transactional tag? Why yes or why not?

0 Answers
Related