kaka
2015-12-28 11:37:02
readonly模式的方法进行写操作异常记录
记录一个异常,今天在修改一个bug的时候,访问了项目中的一个列表页面,后台报如下异常:
Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
根据异常提示可以看出,该异常导致的原因是:只读模式下写操作是不被允许的,查看了报错方法和spring事物的配置文件,所有读方法都是readonly模式,解决该问题要么修改配置文件,要么把写操作从读的这个session中移出来。
评论

weienqing LV17
2017年11月15日
kyoxue LV10
2017年11月9日
nsq0006 LV6
2017年11月7日
zbb LV8
2016年5月1日
thecoolboy LV12
2016年2月18日
k25612006
2016年1月18日
暂无贡献等级
sadma0001 LV3
2016年1月8日
chenlun LV4
2016年1月8日
xkrs1335180261 LV8
2016年1月8日
zyl LV34
2016年1月7日