spring2 hibernate 事物管理配置
annotation:方式
<bean id="txManager"
ref="sessionFactory" />
</bean>
<tx:annotation-driven transaction-manager="txManager"/>
xml方式:
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="getUser" read-only="true" />
<tx:method name="add*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>