Write operations are not allowed in read-only mode

报的错误以下:
java



Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly'marker from transaction definition.



解决办法:
express

检查发现本身的expression路径与新加入的service路径不一样形成的 ide


在以AspectJ方式定义AOP的时候, 会定义service的路径 如:
spa

<aop:pointcut expression="execution(* com.service.impl.*.*(..))"rem

id="allServicesMethod" />it

若是新加的service不在execution的路径中,并使用到了那个service,就会抛出上面所说的异常。
io

相关文章
相关标签/搜索