调用insert()方法报错 Connection is read-only. Queries leading to data modification are not allowed
产生原因
让所有的方法都加入事务管理,类前面加了注解 @Transactional(readOnly = true)
设置为只读的事务,但是增删改就会报错 Connection is read-only.
解决方法
在对应方法前加上如下所示的注解:
@Transactional(readOnly = false)
public void insertOrUpdateByIdCard(YwPerson ywPerson) {
super.save(ywPerson);
}