before I was running a single update as below and it worked fine:
Code:
session.beginTransaction();
/*
int taskId = Integer.parseInt(request.getParameter("taskId"));
String action_taken = request.getParameter("action_taken");
WorkListErrors worklistErrors
= (WorkListErrors) session.load(WorkListErrors.class, new Integer(taskId));
worklistErrors.setAction_taken(action_taken);
session.update(worklistErrors);
session.save(worklistErrors);
session.getTransaction().commit();
but when I try an an update on multiple records it does work when I have a check box checked :
Code:
session.beginTransaction();
/*
int taskId = Integer.parseInt(request.getParameter("taskId"));
String action_taken = request.getParameter("action_taken");
WorkListErrors worklistErrors
= (WorkListErrors) session.load(WorkListErrors.class, new Integer(taskId));
worklistErrors.setAction_taken(action_taken);
session.update(worklistErrors);
session.save(worklistErrors);
session.getTransaction().commit();
session.beginTransaction();
String[] tickedTaskId = request.getParameterValues("tickedTaskId");
String[] taskId = request.getParameterValues("taskId");
String[] action_taken = request.getParameterValues("action_taken");
for(int i=0; i<tickedTaskId.length; i++) {
for(int j = 0; j < taskId.length; j++) {
if(tickedTaskId[i].equals(taskId[j])) {
WorkListErrors worklistErrors
= (WorkListErrors) session.load(WorkListErrors.class, tickedTaskId[i]);
worklistErrors.setAction_taken(action_taken[j]);
session.update(worklistErrors);
session.save(worklistErrors);
session.getTransaction().commit();
}
}
}
/*Close session */
session.close();