7 Replies Latest reply on Dec 13, 2007 7:08 AM by Alexander Seitz

    pagination with lazy loading for readonly tables, seamdiscs

    Petr Kolesnikov Newbie

      seamdiscs example application is a good example how to implement pagination with data lazy loading of readonly tables. I can see though that issued sqls are far far from optimal:


      seam-discs/discs.seam:

      11:05:22,512 INFO [STDOUT] Hibernate: select count(*) as col_0_0_ from Disc disc0_
      11:05:22,512 INFO [STDOUT] Hibernate: select limit ? ? disc0_.id as id6_, disc0_.name as name6_, disc0_.release as release6_, disc0_.artist_id as artist5_6_, disc0_.description as descript4_6_ from Disc disc0_ order by disc0_.name ASC
      11:05:22,512 INFO [STDOUT] Hibernate: select artist0_.id as id4_0_, artist0_.name as name4_0_, artist0_.description as descript4_4_0_, artist0_.DTYPE as DTYPE4_0_ from Artist artist0_ where artist0_.id=?
      11:05:22,512 INFO [STDOUT] Hibernate: select artist0_.id as id4_0_, artist0_.name as name4_0_, artist0_.description as descript4_4_0_, artist0_.DTYPE as DTYPE4_0_ from Artist artist0_ where artist0_.id=?
      11:05:22,512 INFO [STDOUT] Hibernate: select artist0_.id as id4_0_, artist0_.name as name4_0_, artist0_.description as descript4_4_0_, artist0_.DTYPE as DTYPE4_0_ from Artist artist0_ where artist0_.id=?
      11:05:22,512 INFO [STDOUT] Hibernate: select artist0_.id as id4_0_, artist0_.name as name4_0_, artist0_.description as descript4_4_0_, artist0_.DTYPE as DTYPE4_0_ from Artist artist0_ where artist0_.id=?
      11:05:22,527 INFO [STDOUT] Hibernate: select count(*) as col_0_0_ from Disc disc0_
      11:05:22,746 INFO [STDOUT] Hibernate: select artist0_.id as id4_, artist0_.name as name4_, artist0_.description as descript4_4_, artist0_.DTYPE as DTYPE4_ from Artist artist0_ order by artist0_.name11:05:22,934 INFO [STDOUT] Hibernate: select limit ? ? disc0_.id as id6_, disc0_.name as name6_, disc0_.release as release6_, disc0_.artist_id as artist5_6_, disc0_.description as descript4_6_ from Disc disc0_ order by disc0_.name ASC
      11:05:22,934 INFO [STDOUT] Hibernate: select count(*) as col_0_0_ from Disc disc0_


      we have 3 count(*),
      and 2 select from Disc (first getting prev page results, not needed!)

      i think the problem is that trinidad (and richfaces) gets data on apply request values phase (not needed because readonly data)

      do you have a solution for this?