已解决。org.postgresql.util.PSQLException: 错误: 不能在一个只读模式的事务中执行INSERT

org.postgresql.util.PSQLException: 错误: 不能在一个只读模式的事务中执行INSERT

一、情况说明

1.本人项目用的是springboot+mybatis,数据库用得是postgreSQL。
2.报错详情

org.springframework.jdbc.UncategorizedSQLException: 
### Error updating database.  Cause: org.postgresql.util.PSQLException: 错误: 不能在一个只读模式的事务中执行INSERT
### The error may exist in com/test/modules/repository/ConversionTrackRecordsDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters

二、解决方案

我的项目是XXXXServiceImpl实现类调用Dao层
在XXXXServiceImpl实现类上加@Transactional注解,声明式事务管理已解决。org.postgresql.util.PSQLException: 错误: 不能在一个只读模式的事务中执行INSERT_第1张图片

三、@Transactional

@Transactional详解请参考以下质量较好的文章:
https://blog.csdn.net/jiangyu1013/article/details/84397366
https://www.cnblogs.com/dhxcxy/p/15883220.html

你可能感兴趣的:(postgresql,mybatis,java)