在執行添加、刪除、修改方法時出現瞭如下錯誤:
Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
解決辦法:
一、在Service層的這些方法上添加 [Spring.Transaction.Interceptor.Transaction]
二、在Service層的配置文件中從事務繼承過來,例如:
<property name="Target">
<object type="JYLink.Web.Enterprise.Service.Implement.SystemMenusManager, JYLink.Web.Enterprise.Service">
<property name="CurrentDao" ref="Dao.SystemMenus"/>
</object>
</property>