0 Replies Latest reply on Dec 21, 2006 3:50 PM by Sue

    org.hibernate.exception.GenericJDBCException: could not load

    Sue Newbie

      org.hibernate.exception.GenericJDBCException: could not load an entity: [com.dao.hibernate.WorkListErrors#2486]
      org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
      org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
      org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
      org.hibernate.loader.Loader.loadEntity(Loader.java:1799)
      org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
      org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)
      org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)
      org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)
      org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)
      org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)
      org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
      org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
      org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889)
      org.hibernate.impl.SessionImpl.load(SessionImpl.java:808)
      org.hibernate.impl.SessionImpl.load(SessionImpl.java:801)
      com.accuserverx.accucharge.web.UpdateWorkListAction.execute(Unknown Source)
      org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)







      before I was running a single update as below and it worked fine:

      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 :


      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.equals(taskId[j])) {

      WorkListErrors worklistErrors
      = (WorkListErrors) session.load(WorkListErrors.class, tickedTaskId
      );

      worklistErrors.setAction_taken(action_taken[j]);
      session.update(worklistErrors);
      session.save(worklistErrors);

      session.getTransaction().commit();
      }

      }
      }


      /*Close session */
      session.close();