I am getting SocketConnectionException
while generating Excel file for bulk data (more than 0.5 million records).
The code of my web application writes to `outputstream. Here's a snippet of code:
while (sr.next()) {
counter++; //advance counter
view = (DataClass) sr.get(0);
try {
//writing fields values for Activity Report file
reportService.writeExcelFieldsValue(rowCounter,sheet,view,user,exportedFields);
rowCounter++;
} catch (Exception e) {
throw new RuntimeException(e);
}
if (counter == chunkSize || sr.isLast()) {
counter = 0; //reset counter
//Clear the session after a chunk and before next chunk
getSession().clear();
}
}
wb.write(bos);
bos.flush();