Hibernate批量删除出现sql异常Connection is read-only. Queries leading … are not allowed



Hibernate批量删除出现sql异常Connection is read-only. Queries leading … are not allowed。mysql数据库应用。检查代码,没有问题!
忽然想到spring配置文件上,是只读的!

Xml代码  收藏代码
  1. <props>
  2.         <prop key=”create*”>PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>
  3.         <prop key=”save*”>PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>
  4.         <prop key=”add*”>PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>
  5.         <prop key=”remove*”>PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>
  6.         <prop key=”update*”>PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>
  7.         <prop key=”del*”>PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>
  8.         <prop key=”*”>PROPAGATION_REQUIRED,readOnly</prop>
  9.       </props>

把readOnly去掉就可以了