OpensessionInview的配置与事务的关系
<bean id="txManager" ref="sessionFactory"/> </bean><aop:config> <aop:pointcut id="servicePointCut" expression="execution(* com.bjsxt.oa.service.*.*(..))"/> <aop:advisor id="serviceAdvisor" pointcut-ref="servicePointCut" advice-ref="serviceAdvice"/> </aop:config> <tx:advice id="serviceAdvice" transaction-manager="txManager"> <tx:attributes> <tx:method name="add*" /> <tx:method name="del*"/> <tx:method name="modify*"/> <tx:method name="give*"/> <tx:method name="list" read-only="true"/> </tx:attributes> </tx:advice>