使用ssh过程中对数据库进行update时报错
时间:2014-05-01 18:16:35
收藏:0
阅读:377
报错信息:org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove ‘readOnly‘ marker from transaction definition
beans.xml中的问题
<!-- 事务切面 -->
<bean id="tx" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="tm"></property>
<property name="transactionAttributes">
<props>
<prop key="reg">PROPAGATION_REQUIRED</prop>
<prop key="task_*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="tx" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="tm"></property>
<property name="transactionAttributes">
<props>
<prop key="reg">PROPAGATION_REQUIRED</prop>
<prop key="task_*">PROPAGATION_REQUIRED</prop>
<prop key="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
加上红色部分语句就ok了!
评论(0)