Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushM

来源:互联网 发布:天刀捏脸男数据网盘 编辑:程序博客网 时间:2024/05/22 17:04

org.springframework.dao.InvalidDataAccessApiUsageException: 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.


解决办法:

<tx:advice id="txAdvice" transaction-manager="transactionManager"><tx:attributes><tx:method name="add*" propagation="REQUIRED"/><tx:method name="insert*" propagation="REQUIRED"/><tx:method name="update*" propagation="REQUIRED"/><tx:method name="delete*" propagation="REQUIRED"/><tx:method name="create*" propagation="REQUIRED"/></tx:attributes></tx:advice>

0 0
原创粉丝点击