千遍一律的multi-statement not allow解决方案对我没用
2017-12-26 16:13
2935 查看
multi-statement not allow 没有设置批处理,解决方案网上很多,大部分基于以下 (本人基于springBoot开发)
(1)设置WallConfig里面的multiStatementAllow 为true
(2)DB URL追加&allowMultiQueries=true
以上详细内网,网上大把不做赘述。但是对于本人没用。
druid 的配置是基于Filter的,在设置wallConfig的时候事先查看wallConfig在druidDataSource 里面的Filtter是否存在,如果已经存在那么MySqlWallProvider 这个类在初始化的时候就会有可能初始化成另外一个没有配置multiStatementAllow 为true 的Filter,然后放在缓存里面,后面就算你的wallConfig 再次被执行init函数也不再放到缓存里面去.
下面是我在初始化wallConfig的时候打的断点,明显实现就已经存在了WallConfig,如果盲目的在设置一个WallConfig都是白搭,这就是我为什么采用了网上配置之后都是没用的原因
![](https://oscdn.geek-share.com/Uploads/Images/Content/202006/30/04917f9d92d9912b218d0631daaab72b)
下面这个是取druidDataSource的内容进行初始化
![](https://oscdn.geek-share.com/Uploads/Images/Content/202006/30/90fd056fb00e45f0cf1d0e0b8b55a0e5)
解决方法:在设置之前先判断是都已经存在WallConfig,如果有,直接将现有的替换掉
![](https://oscdn.geek-share.com/Uploads/Images/Content/202006/30/35dd494e2a69315e95ddf53e5cd8f2b3)
DB的URL的参数还是得加上&allowMultiQueries=true , 原因网上很多,自行百度,欢迎提问
(1)设置WallConfig里面的multiStatementAllow 为true
(2)DB URL追加&allowMultiQueries=true
以上详细内网,网上大把不做赘述。但是对于本人没用。
druid 的配置是基于Filter的,在设置wallConfig的时候事先查看wallConfig在druidDataSource 里面的Filtter是否存在,如果已经存在那么MySqlWallProvider 这个类在初始化的时候就会有可能初始化成另外一个没有配置multiStatementAllow 为true 的Filter,然后放在缓存里面,后面就算你的wallConfig 再次被执行init函数也不再放到缓存里面去.
下面是我在初始化wallConfig的时候打的断点,明显实现就已经存在了WallConfig,如果盲目的在设置一个WallConfig都是白搭,这就是我为什么采用了网上配置之后都是没用的原因
下面这个是取druidDataSource的内容进行初始化
解决方法:在设置之前先判断是都已经存在WallConfig,如果有,直接将现有的替换掉
DB的URL的参数还是得加上&allowMultiQueries=true , 原因网上很多,自行百度,欢迎提问
相关文章推荐
- MySql+Mybatis+Druid之SqlException:sql injection violation, multi-statement not allow
- springboot druid 数据库批量更新错误 multi-statement not allow
- MySql+Mybatis+Druid:sql injection violation, multi-statement not allow
- SpringBoot+Mybatis+Druid批量更新multi-statement not allow异常
- MySql+Mybatis+Druid:sql injection violation, multi-statement not allow
- [解决方案]CREATE DATABASE statement not allowed within multi-statement transaction.
- Druid执行多条SQL异常:Cause: java.sql.SQLException: sql injection violation, multi-statement not allow
- No Hibernate Session bound to thread, and configuration does not allow create解决方案
- Origin null is not allowed by Access-Control-Allow-Origin解决方案
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- No Hibernate Session bound to thread, and configuration does not allow create解决方案
- rn:strict mode does not allow function declarations in a lexically nested statement
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- Put Delete 请求报错Not Allow Method的解决方案
- [转]-Dmaven.multiModuleProjectDirectory system propery is not set. 解决方案 适用于myeclipes 和 eclipes
- -Dmaven.multiModuleProjectDirectory system propery is not set解决方案
- 理解 SET CHAINED command not allowed within multi-statement transaction.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- MyBatis(7)--spring boot集成MyBatis,集成Druid批量更新报错multi-statement not allow
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.