首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

spring事宜配置实例<2>拦截式

2012-10-20 
spring事务配置实例2拦截式?!-- transaction --?bean nametransactionManager refsessionFactor

spring事务配置实例<2>拦截式

?<!-- transaction -->
?<bean name="transactionManager" ref="sessionFactory"></property>
??? </bean>

????
???? <!-- 配置事务拦截bean -->
?????? <bean id="transactionInterceptor"? ref="transactionManager"/>
???????????? <property name="transactionAttributes">
?????????????????? <props>
?????????????????????? <prop key="insert*">PROPAGATION_REQUIRED</prop>
?????????????????????? <prop key="find*">PROPAGATION_REQUIRED</prop>
?????????????????????? <prop key="add*">PROPAGATION_REQUIRED</prop>
??????????????????????? <prop key="save">PROPAGATION_REQUIRED</prop>
??????????????????????? <prop key="Print*">PROPAGATION_REQUIRED</prop>
?????????????????? </props>
???????????? </property>
?????? </bean>
?????
??????? <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">??
??????????????? <property name="beanNames">?
??????????????????? <value>validateUserBean,authorDaoImp</value>
????????????????
??????????????? </property>?
??????????????? <property name="interceptorNames">??
??????????????????????? <list>??
??????????????????????????????? <value>transactionInterceptor</value>??
??????????????????????????????? <!--此处增加新的Interceptor-->??
??????????????????????? </list>??
??????????????? </property>??
??????? </bean>??
???

热点排行