All pastes #2472200 Raw Edit

Something

public unlisted java v1 · immutable
#2472200 ·published 2013-10-28 15:59 UTC
rendered paste body
 org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: web.entity.Boxes.taskList, could not initialize proxy - no Session@Transactional(readOnly = false)    public ResultImpl getBoardByIdToDisplay(Long id){        Boards board = boardDAO.getBoardById(id);        if (board != null){            Collection<Boxes> childBoxList = new ArrayList<Boxes>();            childBoxList =  board.getChildBoxList();            if(childBoxList.isEmpty() || childBoxList == null){                System.out.println("child boxes are null---");            }else{                System.out.println("childbox list size: "+ childBoxList.size());                crawlBoxes(childBoxList);            }            result.setIsSuccessful(true);            result.setObject(board);            return result;            //result.setMessageList(Arrays.asList("error.userCreationErrorUnknown"/*,"string"*/));        }else{            result.setIsSuccessful(false);            result.setObject(null);            result.setMessageList(Arrays.asList("error.namedBoardDoesNotExist"/*,"string"*/));            return result;        }                            }    @Transactional(readOnly = false)    void crawlBoxes(Collection boxList){        for( Object o : boxList ){           Boxes box = (Boxes)o;               System.out.println("box crawled was: "+ box.getId());           box.getTaskList();           List<Boxes> childBoxList = new ArrayList<Boxes> ( box.getChildBoxList() ); // list of sub child boxes of this box           if(!childBoxList.isEmpty()){               crawlBoxes(childBoxList);           }       }    }