使用ssh过程中对数据库进行update时报错
2024-08-31 14:55:52
报错信息: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了!
最新文章
- BZOJ 2844 albus就是要第一个出场 ——高斯消元 线性基
- jsp静态、动态引入其他jsp
- html5设计原理(转)
- [转]Windows8下设置VS默认启动方式为管理员启动
- MySQL 插入数据时,中文乱码???问题的解决
- POJ 2697 A Board Game (bfs模拟)
- andorid 开发笔记 -- 问题与解决
- 传说中的华为Python笔试题——两等长整数序列互换元素,序列和的差值最小(修正)
- HDU 2102 A计划 经典搜索
- 为什么ajax 必须同源,same origin policy
- GacUtil
- Zip文件和RAR文件解压
- Golang字符串函数认识(一)
- 使用SpringCloud搭建高可用服务注册中心
- MyEclipse CI 2018.8.0正式发布(附下载)
- hdu 1569 &;1565 (二分图带权最大独立集 - 最小割应用)
- Python+Selenium操作select下拉框
- 集训day15 t1 poj3728
- Transact-SQL 参考(数据库引擎)
- 学习路线 roadmap