Spring MVC Controller Transactional

后端 未结 1 1602
余生分开走
余生分开走 2021-01-16 08:52

I\'m trying to get a Spring MVC Controller method which has been annotated with @Transactional to rollback if the network cable in pulled on the client before the method ret

相关标签:
1条回答
  • 2021-01-16 09:11

    Don't make the controller transactional. Transactions are for the service layer. A common practice is to have a base controller, that other controllers extend and contains error handling - in which case different exception messages can be returned.

    You are unplugging a network cable on the client, and expecting an exception on the server ? This doesn't make sense.

    0 讨论(0)
提交回复
热议问题