title: Lazy loading in datatable JSF
body: <p>In many project which I take care of it there is nothing like lazy paging in datatables. </p>
  
  <p>Does JSF have some kind of magic or am I right that its really big performance problem. If you watch some tutorials almost no one take care of lazy paging</p>
  
  <p>Lets say you got List on backing bean and you have 2000 rows in DB.
  If I ll use ORM (JPA) when I want to display DataTable with this list from backing bean. JPA has to map 2000 objects this operation will take some times also allocate a lot of memory.(now imagine 50000 or 1 million objects).
  I dont even mentioned that lazzy fetching is not setup.</p>
  
  <p>Is this something what should I take care of it?
  Also are this objects reusable through application. If two visitors want see same datatable. I hope at least this is true.</p>
  
  <p>What is best solution create event on datatable and in service have method which return data in specified range?</p>