Vikings

简化spring中的事务管理配置(ZT)

<!-- Transactional proxy for the services -->  
    
<bean id="baseTxProxy" lazy-init="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">  
        
<property name="transactionManager"><ref bean="transactionManager"/></property>  
        
<property name="transactionAttributes">  
            
<props>  
                
<prop key="*">PROPAGATION_REQUIRED</prop>  
            
</props>  
        
</property>  
    
</bean>  
  
    
<bean id="itemService" parent="baseTxProxy">  
        
<property name="target">  
            
<bean class="ItemServiceImpl" autowire="byName"/>  
        
</property>  
    
</bean>  
这样的话baseTxProxy也可能被实例化。是不是加上abstract="true"属性,把baseTxProxy只是当作一个模板比较好?因为只需要itemservice这个bean。

posted on 2008-08-07 00:12 Vikings 阅读(280) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: