I am working on a project where I am making use of Hibernate for the first time. I am also using displayTag
When I am suppose to display 1000+ records [say 20 record/page], the pages are loading very slowly.
Also, I find the querry getting fired every time I move on to the next page.
My idea of effective fetching and displaying 1000s of records is fire the querry once and iterate
through the list for every page without hitting the database. Is this idea practicaly feasible ? If yes, can you give me hints how to implement the same. In short I do not want to hit the database again and again
or
Is it possible to fetch only first 20 records for the first page and then fetch next 20 records for next page and so on.
Kindly share your expertise.
Thanks in advance.
Details:
Hibernate version: 3.0
Name and version of the database you are using: Oracle 9i
The generated SQL (show_sql=true):
select MIN(sbbid0_.PER_HOUR_RATE) as col_0_0_, sbbid0_.REQ_LINE_ITEM_ID as col_1_0_, sbbid0_.REQUIREMENT_ID as col_2_0_ from BID sbbid0_, REQ_LINE_ITEM sbreqlinei1_ where (sbbid0_.BID_STATUS_CODE in (10 , 40 , 50 , 60 , 61 , 70 , 80 , 90 , 95 , 33 , 43)) and (sbbid0_.BID_STATUS_CODE not in (33 , 43)) and sbbid0_.DELETION_MARK=0 and sbbid0_.FIT_PERCENTAGE>=sbreqlinei1_.THRESHOLD_OF_FIT and sbreqlinei1_.DELETION_MARK<>1 and sbbid0_.COST_OF_SKILLS>=(select min(sbbid2_.COST_OF_SKILLS) from BID sbbid2_ where sbbid2_.REQ_LINE_ITEM_ID=sbreqlinei1_.REQ_LINE_ITEM_ID and sbbid2_.REQUIREMENT_ID=sbreqlinei1_.REQUIREMENT_ID and (sbbid2_.BID_STATUS_CODE in (10 , 40 , 50 , 60 , 61 , 70 , 80 , 90 , 95 , 33 , 43)) and (sbbid2_.BID_STATUS_CODE not in (33 , 43)) and sbbid2_.DELETION_MARK<>1 and sbbid0_.REQ_LINE_ITEM_ID=sbbid2_.REQ_LINE_ITEM_ID and sbbid0_.REQUIREMENT_ID=sbbid2_.REQUIREMENT_ID and sbbid0_.BID_ID=sbbid2_.BID_ID) group by sbbid0_.REQ_LINE_ITEM_ID , sbbid0_.REQUIREMENT_ID
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am working on a project where I am making use of Hibernate for the first time. I am also using displayTag
When I am suppose to display 1000+ records [say 20 record/page], the pages are loading very slowly.
Also, I find the querry getting fired every time I move on to the next page.
My idea of effective fetching and displaying 1000s of records is fire the querry once and iterate
through the list for every page without hitting the database. Is this idea practicaly feasible ? If yes, can you give me hints how to implement the same. In short I do not want to hit the database again and again
or
Is it possible to fetch only first 20 records for the first page and then fetch next 20 records for next page and so on.
Kindly share your expertise.
Thanks in advance.
Details:
Hibernate version: 3.0
Name and version of the database you are using: Oracle 9i
The generated SQL (show_sql=true):
select MIN(sbbid0_.PER_HOUR_RATE) as col_0_0_, sbbid0_.REQ_LINE_ITEM_ID as col_1_0_, sbbid0_.REQUIREMENT_ID as col_2_0_ from BID sbbid0_, REQ_LINE_ITEM sbreqlinei1_ where (sbbid0_.BID_STATUS_CODE in (10 , 40 , 50 , 60 , 61 , 70 , 80 , 90 , 95 , 33 , 43)) and (sbbid0_.BID_STATUS_CODE not in (33 , 43)) and sbbid0_.DELETION_MARK=0 and sbbid0_.FIT_PERCENTAGE>=sbreqlinei1_.THRESHOLD_OF_FIT and sbreqlinei1_.DELETION_MARK<>1 and sbbid0_.COST_OF_SKILLS>=(select min(sbbid2_.COST_OF_SKILLS) from BID sbbid2_ where sbbid2_.REQ_LINE_ITEM_ID=sbreqlinei1_.REQ_LINE_ITEM_ID and sbbid2_.REQUIREMENT_ID=sbreqlinei1_.REQUIREMENT_ID and (sbbid2_.BID_STATUS_CODE in (10 , 40 , 50 , 60 , 61 , 70 , 80 , 90 , 95 , 33 , 43)) and (sbbid2_.BID_STATUS_CODE not in (33 , 43)) and sbbid2_.DELETION_MARK<>1 and sbbid0_.REQ_LINE_ITEM_ID=sbbid2_.REQ_LINE_ITEM_ID and sbbid0_.REQUIREMENT_ID=sbbid2_.REQUIREMENT_ID and sbbid0_.BID_ID=sbbid2_.BID_ID) group by sbbid0_.REQ_LINE_ITEM_ID , sbbid0_.REQUIREMENT_ID