日期:2014-05-18  浏览次数:20775 次

hibernate批量更新中出现的问题

我利用,批量修改语句对UpLineUser对象进行修改代码如下:
String sql="update UpLineUser a set a.upLineContHoliday='C02' where a.isComeStr='未归队' and a.upLineComeDate<'"+nowDate+"'";
this.getHibernateTemplate().getSessionFactory().openSession().createQuery(sql).executeUpdate();  


但是每次都是因为timeout,超时而修改失败,但是如果我关闭项目,直接在MYSQL里面输入语句,又能够正常执行。

请问这是什么原因,是不是我配置有什么问题?

------解决方案--------------------
探讨

this.getHibernateTemplate().getSessionFactory().openSession().createQuery(sql).executeUpdate();

------解决方案--------------------
超时了就把时间设长点啊
具体去google一下datasource的设置