Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

freeze after 20 iteration

 
Tariik el berrak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a problem and need some help.

I get a connection, i run an sql request with my satement.
the request takes abount 2 minutes and should return 180 rows. when i iterate over the resultset, the program freeze at the 20th rows without any exception.
when i debug it in my eclipse IDE, at the 20th row the iResultSet.next() couldn't be read by the debugger

Any idea???

here is my method in my dao class

===========================================================================================
public List<Record> buildRecords(String request, int idControl,
List<Column> columns) throws SQLException {

logger.log(Level.INFO, "Building records for control : "+idControl+" from request : \n"+request);
long start = System.currentTimeMillis();

List<Record> list = new ArrayList<Record>();
Statement iStmt = null;
ResultSet iResultSet = null;
long elapsed = 0;

try {

iStmt = conn.createStatement();

elapsed = System.currentTimeMillis() - start;


iResultSet = iStmt.executeQuery(request);

logger.info("Request executed in : "+elapsed+" milliseconds with ");

int i = 0;

while (iResultSet.next()) {

logger.log(Level.INFO,"ResultSet["+i+"]");
Record record = new Record(i, idControl);

Column clone = null;

try {

Object idAnomalyStr = iResultSet.getObject(Constant.ID_ANOMALY);
long idAnomaly = Long.parseLong(idAnomalyStr.toString());
record.setIdAnomaly(idAnomaly);
record.setUserlink(iResultSet.getString(Constant.USER_RLINK));

for (Iterator<Column> iColumn = columns.iterator(); iColumn.hasNext();) {

Column column = iColumn.next();
clone = column.clone();
Object value = iResultSet.getObject(column.getName());
clone.setValue(value);
record.addColumn(clone);

}


} catch (SQLException e) {
logger.log(Level.SEVERE, "Couldn't build record cause of column '"
+ clone.getName()+"' for idAnomaly : "+record.getIdAnomaly()+" for control "+idControl, e);

}

list.add(record);

i++;
}

elapsed = System.currentTimeMillis() - elapsed;

logger.info("Data got from resultSet in : "+elapsed+" milliseconds.");

} finally {

closeResultSet(iResultSet);
closeStatement(iStmt);
}

return list;

}


===========================================================================================

 
Paul Clapham
Sheriff
Posts: 21152
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"BugTracker", please check your private messages regarding an important administrative matter.

Thank you.
 
Tariik el berrak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still waiting for help.

Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still waiting for you to correct your display name.
 
Tariik el berrak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Done,
But still waiting for help.

Thanks
 
Campbell Ritchie
Sheriff
Pie
Posts: 49466
64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bugTracker el berrak wrote:Done,
Not according to your profile it isn't.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic