spring 성명 사무

1 、  apring aop tx
<beans
	xmlns="http://www.springframework.org/schema/beans"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
	                    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
	                    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
2、        
	 <bean id="txMgr"
	     class="org.springframework.orm.hibernate3.HibernateTransactionManager">
	     <property name="sessionFactory" ref="sessionFactory"/>
	 </bean>
3、        ,        spring       ,         ,  *,save*     save     。	 
	 <tx:advice id="txAdvise" transaction-manager="txMgr">
	     <tx:attributes>
	         <tx:method name="save*" propagation="REQUIRED"/>
	         <tx:method name="delete*" propagation="REQUIRED"/>
	         <tx:method name="update*" propagation="REQUIRED"/>
	         <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
	     </tx:attributes>
	 </tx:advice>
4、      。 :expression="execution(* a.b.c.*.*(..)) ,   *        ,   *  a.b.c    ,             ,   *     ,..        	
	<aop:config>
	    <aop:pointcut id="allService"
	        expression="execution(* a.b.c.*.*(..))"/>
	    <aop:advisor advice-ref="txAdvise" pointcut-ref="allService"/>
	</aop:config>
http://www.iteye.com/problems/23595

좋은 웹페이지 즐겨찾기