Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 910397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:02:14+00:00 2026-05-15T17:02:14+00:00

Display Tag provides pagination feature from the given object. Hibernates provides option to fetch

  • 0

Display Tag provides pagination feature from the given object. Hibernates provides option to fetch only required record per page.In My project we are using both the concept.

Display Tag:
I need to fetch all the record based on the filter criteria and store it in the Session. Then this displaytag will take care about all pagination and sorting.So Httpsession holds lot of data.

Hibernate:
It fetches only the requested no of Objects from the database.Need to open session for every request.

What is the Best way of doing?Or if we can acheive both the things how to do that? Please help on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:02:14+00:00Added an answer on May 15, 2026 at 5:02 pm

    As you outlined, with the DisplayTag you need to fetch all the results and to put them in the session. So you’re doing only one (potentially expensive) query but this won’t scale well from a memory point of view (if you need to fetch a high number of results or if you increase the number of concurrent users).

    On the other hand, with Hibernate, you can use setFirstResult and setMaxResult to fetch only the records actually shown on each page. This requires to perform a query for each page but will scale for an infinite number of result.

    Personally, I prefer the second approach that I find more memory efficient – especially since most users don’t browse all pages (so why loading all results) – and use the pattern described in Pagination in Hibernate and EJB3.

    If you decide to stick with the first approach, I’d implement some kind of max results number limit to avoid too expensive queries. If a query goes beyond the limit, ask the user to perform a more restrictive search i.e. to add criteria (who is going to browser several thousands of results anyway?).

    And if you need all the results, for example for reporting purposes, then neither the DisplayTag nor the statefull session is the right tool in my opinion.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does the Display tag JSP tag provide a way to hook into pagination events,
Twitter seems to be using an <i/> tag to display their icons from a
Is there a tag in HTML that will only display its content if JavaScript
I have a weird problem. i fetch some rows from database using: while($tag =
I want to align the display tag pagination links 1,2,3, etc and [prev][first] etc
I am using a display tag to display my table and it generating pagination
i want to use facebook's fb:dialog tag to display a simple pop-up form for
Is there anyway to get the alt tag to display quicker? Also, I notice
I'm using the <pre> tag to display preformatted text (including line breaks, spaces and
I am rendering this line of code in a <pre> tag to display as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.