<!-- 事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- 事务代理、所有Bean共享一个代理基类-->
<bean id="transactionBase" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"></property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<!-- 指定目标业务Bean -->
<bean id="tempService" parent="transactionBase" >
<property name="target" ref="tempServiceTarget" />
</bean>
<bean id="tempServiceTarget"
class="com.cj.transaction.service.TempService" abstract="false"
lazy-init="default" autowire="default" dependency-check="default">
<property name="userDAO">
<ref bean="userDAO" />
</property>
<property name="deptDAO">
<ref bean="deptDAO" />
</property>
</bean>