读书人

Hibernate批量删除出现sql错误Connect

发布时间: 2012-11-01 11:11:32 作者: rapoo

Hibernate批量删除出现sql异常Connection is read-only. Queries leading ... are not allowed
在做批量删除时出现:
Connection is read-only. Queries leading to data modification are not allowed
检查代码,没有问题!
忽然想到spring配置文件上,是只读的!

<props>        <prop key="create*">PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>        <prop key="save*">PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>        <prop key="add*">PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>        <prop key="remove*">PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>        <prop key="update*">PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>        <prop key="del*">PROPAGATION_REQUIRED,-com.worthtech.app.exception.SCException</prop>        <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>      </props>

把readOnly去掉就可以了

读书人网 >SQL Server

热点推荐