トランザクション管理
<bean id="nameMatchTransactionAttributeSource" class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource"> <property name="properties"> <props> <prop key="*">PROPAGATION_REQUIRED, ISOLATION_DEFAULT, -java.lang.Exception</prop> </props> </property> </bean> <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor"> <property name="transactionManager"> <ref bean="transactionManager"/> </property> <property name="transactionAttributeSource"> <ref local="nameMatchTransactionAttributeSource"/> </property> </bean> <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"> <property name="beanNames"> <list> <value>*hoge</value> </list> </property> <property name="interceptorNames"> <list> <value>traceInterceptor</value> <value>transactionInterceptor</value> </list> </property> </bean>
例外
<bean id="throwInterceptor" class="org.springframework.aop.ThrowsAdviceを継承したもの"/> <bean id="throwTraceInterceptor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor"> <property name="advice"><ref local="throwInterceptor"/></property> <property name="pattern"><value>.*Hoge.*</value></property> </bean>