We have 40k rows. On the list screen, because of pagination we shows 25 at a times. So it works fine. The real problem comes into picture, when we do export csv for 40k rows.
We are using the regular jar excel provided by seam. We are using this regular class for exporting csv.
/**
* Excel export class that exports a UIData component to an Excel workbook
*
* @author Nicklas Karlsson (nickarls@gmail.com)
* @author Daniel Roth (danielc.roth@gmail.com)
*
*/
@Name("exporter")
@Scope(ScopeType.EVENT)
@Install(precedence=Install.FRAMEWORK)
@BypassInterceptors
public class ExcelExporter
Inside this class method, export it is retieving UIData component in a 1 shot. So it is firing 40k sql for 40k rows. This thing really consumes too much memory.
'
UIData dataTable = (UIData) FacesContext.getCurrentInstance().getViewRoot().findComponent(dataTableId);
'
Is it possible to create excel sheet and it dynamically fires sql quieries behind the scenes doing pagination instead of 1 shot UIdata?
or
Modify the UIdata component not to hold all data, just hold references to different rows. This may save memory.