java ssh项目更新问题,先查询数据,然后进行更新操作,为什么保存不成功?下面有代码和控制台的一些信息
publicvoidchangeBidpToPool(){Stringids=Struts2Utils.getParameter("ids");Stringidps[]=...
public void changeBidpToPool() {
String ids = Struts2Utils.getParameter("ids");
String idps[] = ids.split(",");
Criterion criterion = Restrictions.in("id", idps);
@SuppressWarnings("unchecked")
List<BidProject> bidPools = (List<BidProject>) getObjectService()
.findByCriteria(BidProject.class, criterion);
for (BidProject bidProject : bidPools) {
bidProject.setTempType(Short.valueOf("1"));
}
getObjectService().batchSaveOrUpdate(bidPools);
}
>>> 2012-08-02 09:09:31,025 DEBUG [http-bio-8080-exec-8] (AbstractBatcher.java:426) - about to open ResultSet (open ResultSets: 0, globally: 0)
>>> 2012-08-02 09:09:31,041 DEBUG [http-bio-8080-exec-8] (Loader.java:1197) - result row: EntityKey[com.ht.oa.hibernate.bean.BidProject#4028814b38e141a10138e14a1ab30001]
>>> 2012-08-02 09:09:31,041 DEBUG [http-bio-8080-exec-8] (AbstractBatcher.java:433) - about to close ResultSet (open ResultSets: 1, globally: 1)
>>> 2012-08-02 09:09:31,056 DEBUG [http-bio-8080-exec-8] (AbstractBatcher.java:418) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
>>> 2012-08-02 09:09:31,056 DEBUG [http-bio-8080-exec-8] (TwoPhaseLoad.java:130) - resolving associations for [com.ht.oa.hibernate.bean.BidProject#4028814b38e141a10138e14a1ab30001]
>>> 2012-08-02 09:09:31,072 DEBUG [http-bio-8080-exec-8] (TwoPhaseLoad.java:226) - done materializing entity [com.ht.oa.hibernate.bean.BidProject#4028814b38e141a10138e14a1ab30001]
>>> 2012-08-02 09:09:31,072 DEBUG [http-bio-8080-exec-8] (StatefulPersistenceContext.java:860) - initializing non-lazy collections
>>> 2012-08-02 09:09:31,072 DEBUG [http-bio-8080-exec-8] (ConnectionManager.java:325) - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
>>> 2012-08-02 09:09:31,088 DEBUG [http-bio-8080-exec-8] (HibernateTemplate.java:422) - Not closing pre-bound Hibernate Session after HibernateTemplate
>>> 2012-08-02 09:10:02,085 DEBUG [http-bio-8080-exec-8] (HibernateTemplate.java:397) - Found thread-bound Session for HibernateTemplate
>>> 2012-08-02 09:10:02,085 DEBUG [http-bio-8080-exec-8] (HibernateTemplate.java:422) - Not closing pre-bound Hibernate Session after HibernateTemplate
>>> 2012-08-02 09:10:02,085 DEBUG [http-bio-8080-exec-8] (CommonsLogger.java:68) - Checking ConfigurationProviders for reload.
>>> 2012-08-02 09:10:02,100 DEBUG [http-bio-8080-exec-8] (Log4JLoggerFactory.java:81) - org/apache/struts2/dispatcher/error.ftl[zh_CN,UTF-8,parsed] using cached since jar:file:/D:/apache-tomcat-7.0.27/webapps/ChinaYXY/WEB-INF/lib/struts2-core-2.2.1.jar!/org/apache/struts2/dispatcher/error.ftl didn't change.
>>> 2012-08-02 09:10:02,100 DEBUG [http-bio-8080-exec-8] (Log4JLoggerFactory.java:81) - Key 'location' was not found on instance of org.springframework.dao.InvalidDataAccessApiUsageException
大家帮忙看一下该怎么解决? 展开
String ids = Struts2Utils.getParameter("ids");
String idps[] = ids.split(",");
Criterion criterion = Restrictions.in("id", idps);
@SuppressWarnings("unchecked")
List<BidProject> bidPools = (List<BidProject>) getObjectService()
.findByCriteria(BidProject.class, criterion);
for (BidProject bidProject : bidPools) {
bidProject.setTempType(Short.valueOf("1"));
}
getObjectService().batchSaveOrUpdate(bidPools);
}
>>> 2012-08-02 09:09:31,025 DEBUG [http-bio-8080-exec-8] (AbstractBatcher.java:426) - about to open ResultSet (open ResultSets: 0, globally: 0)
>>> 2012-08-02 09:09:31,041 DEBUG [http-bio-8080-exec-8] (Loader.java:1197) - result row: EntityKey[com.ht.oa.hibernate.bean.BidProject#4028814b38e141a10138e14a1ab30001]
>>> 2012-08-02 09:09:31,041 DEBUG [http-bio-8080-exec-8] (AbstractBatcher.java:433) - about to close ResultSet (open ResultSets: 1, globally: 1)
>>> 2012-08-02 09:09:31,056 DEBUG [http-bio-8080-exec-8] (AbstractBatcher.java:418) - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
>>> 2012-08-02 09:09:31,056 DEBUG [http-bio-8080-exec-8] (TwoPhaseLoad.java:130) - resolving associations for [com.ht.oa.hibernate.bean.BidProject#4028814b38e141a10138e14a1ab30001]
>>> 2012-08-02 09:09:31,072 DEBUG [http-bio-8080-exec-8] (TwoPhaseLoad.java:226) - done materializing entity [com.ht.oa.hibernate.bean.BidProject#4028814b38e141a10138e14a1ab30001]
>>> 2012-08-02 09:09:31,072 DEBUG [http-bio-8080-exec-8] (StatefulPersistenceContext.java:860) - initializing non-lazy collections
>>> 2012-08-02 09:09:31,072 DEBUG [http-bio-8080-exec-8] (ConnectionManager.java:325) - transaction completed on session with on_close connection release mode; be sure to close the session to release JDBC resources!
>>> 2012-08-02 09:09:31,088 DEBUG [http-bio-8080-exec-8] (HibernateTemplate.java:422) - Not closing pre-bound Hibernate Session after HibernateTemplate
>>> 2012-08-02 09:10:02,085 DEBUG [http-bio-8080-exec-8] (HibernateTemplate.java:397) - Found thread-bound Session for HibernateTemplate
>>> 2012-08-02 09:10:02,085 DEBUG [http-bio-8080-exec-8] (HibernateTemplate.java:422) - Not closing pre-bound Hibernate Session after HibernateTemplate
>>> 2012-08-02 09:10:02,085 DEBUG [http-bio-8080-exec-8] (CommonsLogger.java:68) - Checking ConfigurationProviders for reload.
>>> 2012-08-02 09:10:02,100 DEBUG [http-bio-8080-exec-8] (Log4JLoggerFactory.java:81) - org/apache/struts2/dispatcher/error.ftl[zh_CN,UTF-8,parsed] using cached since jar:file:/D:/apache-tomcat-7.0.27/webapps/ChinaYXY/WEB-INF/lib/struts2-core-2.2.1.jar!/org/apache/struts2/dispatcher/error.ftl didn't change.
>>> 2012-08-02 09:10:02,100 DEBUG [http-bio-8080-exec-8] (Log4JLoggerFactory.java:81) - Key 'location' was not found on instance of org.springframework.dao.InvalidDataAccessApiUsageException
大家帮忙看一下该怎么解决? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询