Connection is read-only. Queries leading to data modification are not allowed

今天同学在写代码的时候说他在向数据库存数据时,报了个异常,说存不进去。
然后我上网查了一下,找到了解决方法。
https://www.cnblogs.com/fiving1314/p/8534680.html

引起这个异常是因为他定义的方法名和applicationContext.xml配置文件中的事务配置的方法名不匹配。
他将方法名首字母大写了,所以引起了这个异常。
变量,方法名用小驼峰命名法,类名用大驼峰命名法。

异常:
连接是只读的。不允许导致数据修改的查询。
Connection is read-only. Queries leading to data modification are not allowed
Connection is read-only. Queries leading to data modification are not allowed
解决方法:
检查自己定义的方法名是否与applicationContext.xml配置文件中的事务配置里的方法名是否匹配。
Connection is read-only. Queries leading to data modification are not allowed