proxyfactory transaction

xml 代码
  1. <beans>  
  2.   ...   
  3.   
  4.   <bean id="myTxManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">  
  5.     <property name="sessionFactory" ref="mySessionFactory"/>  
  6.   </bean>  
  7.   
  8.   <bean id="myProductServiceTarget" class="product.ProductServiceImpl">  
  9.     <property name="productDao" ref="myProductDao"/>  
  10.   </bean>  
  11.   
  12.   <bean id="myProductService"  
  13.         class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">  
  14.     <property name="transactionManager" ref="myTxManager"/>  
  15.     <property name="target" ref="myProductServiceTarget"/>  
  16.     <property name="transactionAttributes">  
  17.       <props>  
  18.         <prop key="increasePrice*">PROPAGATION_REQUIRED</prop>  
  19.         <prop key="someOtherBusinessMethod">PROPAGATION_REQUIRES_NEW</prop>  
  20.         <prop key="*">PROPAGATION_SUPPORTS,readOnly</prop>  
  21.       </props>  
  22.     </property>  
  23.   </bean>  
  24.   
  25. </beans>  

你可能感兴趣的:(Hibernate,xml,bean,orm)