报错:Connection is read-only. Queries leading to data modification are not allowed [n/a] java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
解决:
<tx:advice id="txAdvice" transaction-manager="htm">
<tx:attributes>
<tx:method name="*" propagation="REQUIRED" read-only="true" /> //去掉这句,或者将方法名改为下面这种开头的
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
由于在代码 read-only属性中设置了true所以才会报这个错。