I am getting java.lang.StackOverflowError
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:40)
can any one help me plzzz it is very urgent.
Scenario: I have 17k records .
while updating first i need to update with i_... in an column then start updating for 17k records
while doing this process am getting stackoverflow......
below is the code.
Code:
private List regenerateAreaCatStrucBySeq(CategoryBean catBn,Session ssn)
{
if(catBn!=null)
{
_log.info("regenerateAreaCatStrucBySeq"+catBn.getSequenceId().intValue());
}
List catLst = null;
CategoryBean areaCat = null;
String oldCatstruc = null;
NumberFormat formate = null;
Integer size = null;
int j = 1;
int maxSeqIdOfSuperLvlCat = 0;
List catList = null;
try
{
catList = new ArrayList();
maxSeqIdOfSuperLvlCat = catDao.getMaxCatSeqIdOfAreas(catBn.getOwnerId(),catBn.getClientId()).intValue();
if(catBn.getSequenceId().intValue() < maxSeqIdOfSuperLvlCat)
{
catLst = catDao.getAllCateogry(catBn.getOwnerId(), catBn.getClientId(),ssn);
size = new Integer(catBn.getStruc().length());
formate = new DecimalFormat(catDao.getZeros(size.toString()));
setAllDuplicateAreaEntries(catLst,formate,ssn);
catLst = catDao.getAreaCateogry(catBn.getOwnerId(), catBn.getClientId(),ssn);
for(int i=0; i< catLst.size() ; i++)
{
areaCat = (CategoryBean)catLst.get(i);
oldCatstruc = areaCat.getStruc();//.substring(areaCat.getStruc().lastIndexOf("_")+1
// _log.info("oldCatstruc--------------------"+oldCatstruc);
j++;
resetChildCatruc(areaCat,j,formate);
catDao.updateforSsn(areaCat,ssn);
// _log.info("Area category is set Sucessfully!!!");
catList.addAll(regenerateCatStruc(areaCat,oldCatstruc,ssn));
}
}
return catList;
}
catch (Exception e)
{
e.printStackTrace();
throw new SecurityException(e.getMessage());
}
catch(StackOverflowError t) {
t.printStackTrace();
throw new SecurityException(t.getMessage());
}
}
private List regenerateCatStruc(CategoryBean catBn,String oldAreaCatStruc,Session ssn)
{
List lst = null;
NumberFormat formate = null;
Integer size = null;
LinkedHashMap childCatMap = null;
CategoryBean childCat = null;
try
{
childCatMap = new LinkedHashMap();
if (catBn.getStruc().indexOf(".") != -1)
size = new Integer(catBn.getStruc().substring(0,catBn.getStruc().indexOf(".")).length());
else
size = new Integer(catBn.getStruc().length());
formate = new DecimalFormat(catDao.getZeros(size.toString()));
if (!oldAreaCatStruc.equals(""))
{
// _log.info("catBn------------"+oldAreaCatStruc);
// _log.info("catBn.getStruc()+oldAreaCatStruc------------"+catBn.getStruc()+"/"+oldAreaCatStruc);
// _log.info("catBn.getCategoryId()------------"+catBn.getCategoryId());
childCatMap.put(catBn.getCategoryId(), catBn.getStruc()+"/"+oldAreaCatStruc);
lst = catDao.getchildInfoFromDispSeq(catBn.getOwnerId(),catBn.getClientId(),oldAreaCatStruc,ssn);
//_log.info("lst in oldareacatstruc------------"+lst);
}
else
{
lst = catDao.getAllChildCateogry(catBn.getOwnerId(), catBn.getClientId(), catBn.getStruc(), ssn);
setAllDuplicateAreaEntries(lst,formate,ssn);
lst = catDao.getchildInfoFromDispSeq(catBn.getOwnerId(),catBn.getClientId(),catBn.getStruc(),ssn);
}
if(lst != null && lst.size()>0)
return updateChildDetails(lst, childCatMap, formate,ssn);
return new ArrayList();
}
catch (Exception e)
{
e.printStackTrace();
throw new SecurityException(e.getMessage());
}
catch(StackOverflowError t) {
t.printStackTrace();
throw new SecurityException(t.getMessage());
}
}