you might be using lazy="true" in hbm and then try to use that object. You can change it to false but then performance may take a hit
Hemant Pagare
Greenhorn
Joined: Mar 12, 2008
Posts: 9
posted
0
my DAO method code is as follows
Query result = createQuery("select timeOfOp,operation,callerFromNumber,callerToNumber from LogsData where timeOfOp >= '"+startDate+"' and timeOfOp <= '"+endDate+"' order by timeOfOp"); List list =result.list(); logger.infoLog("*******Size of List ="+list.size()); Iterator iterator = list.iterator(); LogsData logsData=null; while(iterator.hasNext()) { logsData=new LogsData(); logsData = (LogsData)iterator.next(); logsDataList.add(logsData); } logger.infoLog("results size="+logsDataList.size()); closeSession(); return logsDataList;
Edvins Reisons
Ranch Hand
Joined: Dec 11, 2006
Posts: 364
posted
0
As Mark said, you may be trying to do all this outside of a Session. I see a method for closing the Session, but where was it created?
Hemant Pagare
Greenhorn
Joined: Mar 12, 2008
Posts: 9
posted
0
Hi Edvin session was created in superclass which has createQuery method.
Edvins Reisons
Ranch Hand
Joined: Dec 11, 2006
Posts: 364
posted
0
In a case like this, with the relevant code hidden within a framework� Not to exclude that some Rancher would take the challenge and dig into everything, but you'll find a bigger audience if you refactor the code into standard Hibernate usage, as in most books and online examples. And it is not rare to get the problem resolved in the process . Hope this helps.