您的位置:首页 > 其它

SSH批量更新getHibernateTemplate().bulkUpdate(hql)

2012-04-16 10:48 453 查看
当用getHibernateTemplate().bulkUpdate(hql)这个方法是会报错.

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute update query; uncategorized SQLException for SQL [update lring3.users set password=? where deptid=1]; SQL state [S1009]; error code [0]; Connection is read-only. Queries leading to data modification are not allowed; nested exception is java.sql.SQLException: Connection is read-only. Queries leading to data modification are not allowed

是因为在为spring配置事务时

<tx:method name="*" propagation="REQUIRED" read-only="true" />

将read-only="true"即:

<tx:method name="*" propagation="REQUIRED"/>

项目就正常运行.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  批量更新