java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

1、本问题出现在动力节点crm项目中的p85-p88

2、出现问题时applicationContext-datasource的配置

java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed_第1张图片

 3、报出的异常(里面有只读异常,还有就是sql中接收的id是?)

### Error updating database.  Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed
### The error may exist in com/bjpowernode/crm/workbench/mapper/ActivityMapper.xml
### The error may involve com.bjpowernode.crm.workbench.mapper.ActivityMapper.delectActivityByIds-Inline
### The error occurred while setting parameters
### SQL: delete from crm2008.tbl_activity where id in      (        ?      )
### Cause: java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

我的错误想法:之前编写增加功能时,可以正常添加,怎么可能是“只读”,所以这个错误的判断,让我走上了找bug的不归路

4、分析前端

java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed_第2张图片

通过请求可以看出,前端是可以返回id的,也就是说,是后台接收的问题

5、通过反复查看,确定接收参数,sql语句,没有任何问题!(避免啰嗦controller代码就不放了)

  
  
    delete from crm2008.tbl_activity where id in
    
     #{id}
    
  

 6、回到只读问题

java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed_第3张图片

看到没有,没错是*害了我o(╥﹏╥)o

7、read-only="false"后,一切又恢复到了风平浪静。

 第一次写文章,肯定有很多不足之处,希望大佬们不要介意哦。(完)

 

你可能感兴趣的:(java,sql,开发语言)