spring2 hibernate 事物治理配置

spring2 hibernate 事物管理配置annotation:方式bean idtxManagerrefsessionFactory //beantx:

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>