在使用springmvc上传excel文件时,报这个错误。

是因为在上传时,调用的后台插入方法起名字的时候是importCJ.do ,但是applicationContext.xml文件里边配置的事务其中没有配置import开头的方法,所以执行importCJ.do(插入)会被按照最后的那个 * 的只读的配置,就会报如上错误。

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

解决办法就是  在xml中加上这个开头的事务配置:

<tx:method name="import*" propagation="REQUIRED" />


错误记录,理解尚浅,仅供参考。

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
猜你喜欢
  • 2021-06-29
  • 2021-04-08
相关资源
相似解决方案