報的錯誤如下:
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.
解決辦法:
檢查發現自己的expression路徑與新加入的service路徑不同造成的
在以AspectJ方式定義AOP的時候, 會定義service的路徑 如:
<aop:pointcut expression="execution(* com.service.impl.*.*(..))"
id="allServicesMethod" />
如果新加的service不在execution的路徑中,並使用到了那個service,就會拋出上面所說的異常。