本文介绍了@Transactional 和 AOP 之间的混淆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
@Transactional 是否在 spring 3 中替代 AOP.它们相同吗?我可以说@Transactional 在内部实现 AOP 吗?
Does @Transactional is replacement for AOP in spring 3. are they same? Can I say @Transactional implements AOP internally ?
推荐答案
@Transactionnal
注释只是一种简单的方式来声明一个方法(或一个类的所有方法)都是事务性的.
The @Transactionnal
annotation is just a simple way to declare that a method is (or all methods of a class are) transactionnal.
Spring Framework 将使用 AOP 代理来拦截对方法的调用并管理事务.
The Spring Framework will use an AOP proxy to intercept calls to the method and manage transaction.
所以,我们可以说 @Transactionnal
在内部使用 AOP.
So, we can say that @Transactionnal
use AOP internally.
更多信息 这里
这篇关于@Transactional 和 AOP 之间的混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!