Confusion between @Transactional and AOP

余生长醉 提交于 2019-12-02 08:11:44

The @Transactionnal annotation is just a simple way to declare that a method is (or all methods of a class are) transactionnal.

The Spring Framework will use an AOP proxy to intercept calls to the method and manage transaction.

So, we can say that @Transactionnal use AOP internally.

More information here

What you can say is that Spring uses AOP to add a transactional aspect to bean methods annotated with @Transactional: before executing such a method, it starts a transaction (if necessary), and after the method has been executed, it commits or rollbacks the transaction.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!