事务引起的 read-only mode (FlushMode.NEVER)

在执行添加、删除、修改方法时出现了以下错误:
Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
解决办法:
1、在Service层的这些方法上添加 [Spring.Transaction.Interceptor.Transaction]
2、在Service层的配置文件中从事务继承过来,例如:
<property name="Target">
        <object type="JYLink.Web.Enterprise.Service.Implement.SystemMenusManager, JYLink.Web.Enterprise.Service">
        <property name="CurrentDao" ref="Dao.SystemMenus"/>
        </object>
</property>


你可能感兴趣的:(read-only,FlushMode.NEVER)