67,512
社区成员
发帖
与我相关
我的任务
分享
<!-- 事务管理实体 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- 事务配置 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 查询方法只读 -->
<tx:method name="find*" propagation="REQUIRED" read-only="true"/>
<!-- 其它方法使用普通事务 -->
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<!-- aop切入 -->
<aop:config>
<aop:pointcut expression="execution(* com.ssh.service.*.*(..))" id="interCut"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="interCut"/>
</aop:config>