Transaction configuration of spring boot mybatis

  • The Application class is annotated with: @EnableTransactionManagement
  • Find your service implementation class and add the @Transactional annotation. If you add it to the class, all the methods of the class will be managed by transactions. If you add it to the method, only the method conforms to the specific transaction. Of course, we generally add to the method. Because only additions, deletions, and changes will require transactions

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325462001&siteId=291194637