我有一个加载持久对象然后更新它的方法。当我使用 flush() 时,进程挂起,没有错误。任何想法?
代码:
public Task changeStatus(Long taskNo, String status) {
Session sess = HibernateUtil
.getSessionFactory()
.openSession();
Task task = (Task) sess.load(Task.class, taskNo);
task.setStatus(status);
sess.flush();
return task;
}
日志显示:
信息:09:33:05,329 调试打印机:83 - 列出实体:
信息:09:33:05,329 调试打印机:90 - models.Task{userByAssignedToCheck=null,client=models.Client#1,status=Withdrawn,datasets=,urgent=false,taskLogs=,userByCheckedBy=null,dateReceived=8 月 29 日2013, dateCompleted=null, fee=null, onTime=false, userByOriginatorId=models.User#1, taskCat=null, userByAssignedToWork=null, source=null, originatorOld=null, description=null, userByCompletedBy=null, method=null, taskNo=11492,dueDate=null,requestVia=null,comments=}
INFO:09:33:05,329 DEBUG AbstractBatcher:366 - 即将打开 PreparedStatement(打开 PreparedStatements:0,全局:0)
INFO: 09:33:05,329 DEBUG SQL:401 - /* update models.Task */ update DBAKZHU0.INFO_TASK set CLIENTNO=?, ASSIGNEDTOCHECK=?, TASKTYPENO=?, COMPLETEDBY=?, CHECKEDBY=?, ORIGINATORID=?, SOURCENO =?, ASSIGNEDTOWORK=?, METHOD=?, REQUESTVIA=?, DATERECEIVED=?, DATECOMPLETED=?, DUEDATE=?, STATUS=?, ORIGINATOROLD=?, ONTIME=?, URGENT=?, FEE=?, DESCRIPTION=? 哪里任务=?
INFO: Hibernate: /* update models.Task */ update DBAKZHU0.INFO_TASK set CLIENTNO=?, ASSIGNEDTOCHECK=?, TASKTYPENO=?, COMPLETEDBY=?, CHECKEDBY=?, ORIGINATORID=?, SOURCENO=?, ASSIGNEDTOWORK=?, METHOD =?, REQUESTVIA=?, DATERECEIVED=?, DATECOMPLETED=?, DUEDATE=?, STATUS=?, ORIGINATOROLD=?, ONTIME=?, URGENT=?, FEE=?, DESCRIPTION=? 哪里任务=?