This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes freeze after 20 iteration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "freeze after 20 iteration" Watch "freeze after 20 iteration" New topic

freeze after 20 iteration

Tariik el berrak

Joined: Jan 23, 2009
Posts: 9

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 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);"Request executed in : "+elapsed+" milliseconds with ");

int i = 0;

while ( {

Record record = new Record(i, idControl);

Column clone = null;

try {

Object idAnomalyStr = iResultSet.getObject(Constant.ID_ANOMALY);
long idAnomaly = Long.parseLong(idAnomalyStr.toString());

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

Column column =;
clone = column.clone();
Object value = iResultSet.getObject(column.getName());


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




elapsed = System.currentTimeMillis() - elapsed;"Data got from resultSet in : "+elapsed+" milliseconds.");

} finally {


return list;



Paul Clapham

Joined: Oct 14, 2005
Posts: 19869

"BugTracker", please check your private messages regarding an important administrative matter.

Thank you.
Tariik el berrak

Joined: Jan 23, 2009
Posts: 9
Still waiting for help.

Thanks in advance
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42959
Still waiting for you to correct your display name.
Tariik el berrak

Joined: Jan 23, 2009
Posts: 9
But still waiting for help.

Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45350
bugTracker el berrak wrote:Done,
Not according to your profile it isn't.
I agree. Here's the link:
subject: freeze after 20 iteration
It's not a secret anymore!