<tx:advice id="transactionAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="query*" propagation="NOT_SUPPORTED" read-only="true"/> <tx:method name="find*" propagation="NOT_SUPPORTED" read-only="true"/> <tx:method name="*" propagation="REQUIRED"/> </tx:attributes> </tx:advice>
一定注意 方法的事务find的定义 否则当pojo set值的时候hibernate会去持久化