请问怎样配置Spring的事务自动代理啊?我配置的这个怎么出现异常?

来源:百度知道 编辑:UC知道 时间:2024/06/15 23:33:13
请问怎样配置Spring的事务自动代理啊?我配置的这个怎么出现异常?
我的配置如下:
<!-- 配置事务拦截器-->
<bean id="transactionInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref bean="transactionManger" />
</property>
<!-- 下面定义事务传播属性-->
<property name="transactionAttributes">
<props>
<prop key="find*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="merge*">PROPAGATION_REQUIRED</prop>
<prop key="attach*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>

<!-- 自动代理 -->
<bean id=&quo

<ref bean="transactionManger" /> 掉了一个a
transactionManager"

而且里面也没有声明 transactionMangaer bean
其实这个配置很麻烦
为什么不用Spring 2.0 的声明式AOP

CGLIB代理在运行期间产生目标对象的子类,该子类通过装饰器设计模式加入到Advice中。因为CGLIB代理是目标对象的子类,则必须考虑保证如下两点:

目标类不能声明成final,因为final类不能被继承,无法生成代理。

目标方法也不能声明成final,final方法不能被重写,无法得到处理。