0 Replies Latest reply on Jun 16, 2010 11:28 AM by Rocky S

    Excel Export Out of Memory Issue because of UIData ?

    Rocky S Master
      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)
      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?


      Modify the UIdata component not to hold all data, just hold references to different rows. This may save memory.