HTTP Status 500 - 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.
翻译:HTTP状态500-写操作不允许以只读模式(FlushMode.MANUAL):把你的会话变成“流动模式”。提交/自动或从事务定义中删除“readOnly”标记。
解决:检查execution(public * org.chunqiu123.*.service.impl.*ServiceImpl.*(..))"表达式是否书写正确。
大致解析:
错误位置在事务管理。而AOP事务增强一般都将事务插进service层。 所以,插入路径写错了。没有将事务注入到service
层中,没有开启事务。dao层执行数据库操作会报错。
听大牛同学说,如果是事务管理报错,一般都是execution表达式书写有误。