如何使用英特尔®oneAPI工具实现PyTorch 优化,直播火热报名中>>>
### Error updating database. Cause: org.postgresql.util.PSQLException: 错误: 不能在一个只读模式的事务中执行INSERT
### The error may involve com.community.persistence.UserMapper.insertUser-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO cs_user (id, nick_name, login_name, login_pwd, email, phone, identity_card, createTime, updateTime) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);
### Cause: org.postgresql.util.PSQLException: 错误: 不能在一个只读模式的事务中执行INSERT
; uncategorized SQLException for SQL []; SQL state [25006]; error code [0]; 错误: 不能在一个只读模式的事务中执行INSERT; nested exception is org.postgresql.util.PSQLException: 错误: 不能在一个只读模式的事务中执行INSERT
这是个什么错误spring+mybatis
遇到了同样的问题,搜索的时候找到这里,不过没有答案,很郁闷。。。
最终解决了,发现是Spring事务配置的原因,我的方法是以create为前缀的,但并没有在配置文件中进行配置,然后发现Spring事务配置有这么一句
所以没有在前面配置被匹配上的都被认为是只读的了。/(ㄒoㄒ)/~~
添加了配置就解决了。配置如下:
这个错误难道是因为你,在一个只读模式的事务中执行了INSERT?