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

Springboot+mybatis修改操作时候,出现java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed; SQL []; Connection is read-only. Queries leading to data modification are not allowed; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

Connection is read-only. Queries leading to data modification are not allowed” 是一个常见的错误信息,它表示你正在尝试执行一个修改操作,但是数据库连接是只读的,不允许执行修改操作。这个错误信息通常由以下原因导致:

数据库连接是只读的:如果你的数据库连接是只读的,那么你就无法执行修改操作。这可能是由于以下原因之一导致的:

  1. 数据库配置错误:如果你的数据库配置不正确,可能会导致数据库连接是只读的。例如,如果你的数据库服务器没有启动,或者你的数据库连接配置不正确,可能会导致数据库连接是只读的。
  2. 数据库访问权限错误:如果你没有足够的数据库访问权限,可能会导致数据库连接是只读的。例如,如果你没有足够的权限执行修改操作,可能会导致数据库连接是只读的
  3. 数据库事务管理错误:如果你的数据库事务管理不正确,可能会导致数据库连接是只读的。例如,如果你没有正确地启用事务,或者你的事务没有正确地提交,可能会导致数据库连接是只读的。

@Transactional(readOnly=false) 改为false

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
扎眼的阳光的头像扎眼的阳光普通用户
上一篇 2023年12月26日
下一篇 2023年12月26日

相关推荐