亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

HTTP Status 500 - 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.

http://img1.sycdn.imooc.com//5944d4750001be1208790099.jpg

添加

<init-param>

? ? ? ? <param-name> flushMode </param-name>

? ?<param-value>AUTO </param-value> ? ? ? ?

? ? ? ? </init-param>

后沒有作用

正在回答

4 回答

可以參考這里。http://blog.csdn.net/violet_echo_0908/article/details/51084884

0 回復 有任何疑惑可以回復我~

@Transactional(readOnly = false, propagation = Propagation.REQUIRES_NEW)

在service類開頭加上這句,也行,盡管readOnly的默認值為false

0 回復 有任何疑惑可以回復我~

<!-- 定義事務管理 -->
?<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
? <property name="sessionFactory" ref="sessionFactory"/>
?</bean>
?
?<!-- 通過<tx:advice>標簽定義事務增強,并指定事務管理器 -->
?<tx:advice id="txAdvice" transaction-manager="txManager">
? <!-- 定義屬性,聲明事務規則 -->
? <tx:attributes>
?? <tx:method name="*findAll*" read-only="true"/>
?? <tx:method name="*save*" propagation="REQUIRED"/>
??? <tx:method name="*delete*" propagation="REQUIRED"/>
???? <tx:method name="*update*" propagation="REQUIRED"/>
? </tx:attributes>
?</tx:advice>
?
?<!-- 定義切面 -->
?<aop:config>
? <!-- 定義切入點 -->
? <aop:pointcut expression="execution(* com.jbit.service.*.*(..))" id="serviceMethod"/>
? <!-- 將事務增強與切入點組合 -->
? <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethod"/>
?</aop:config>

0 回復 有任何疑惑可以回復我~

需要配置事務管理器才行

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

HTTP Status 500 - 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.

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號