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 8002023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:14:55+00:00 2026-06-04T16:14:55+00:00

I have a problem with a page loading of data. rich:datatable is used to

  • 0

I have a problem with a page loading of data. rich:datatable is used to display list of announcements.

Announcement class include Set of AnnouncedLot class and in a mapping it is specified as

<set cascade="all,delete-orphan" lazy="false" name="lots" table="ad_lot">
<key column="lotId"/>
<many-to-many class="AnnouncedLot" column="anlotId"/>
</set>

AnnouncedLot class mapping is

<class name="AnnouncedLot" table="announcedLot">
  <id name="id" type="java.lang.Long" unsaved-value="-1">
     <generator class="native"/>
  </id>
  <property name="idValue" not-null="false" unique="true"/>
  <property name="databaseId" not-null="false" unique="true"/>
  <property length="4047" name="title"/>
  <property length="4047" name="description"/>
  <property length="4047" name="source"/>
  <property length="65534" name="adText"/>
  <property name="sum"/>
</class>

At the moment there are about 1,5 million of announcement in the database and 3,5 millions of lots. One announcement can have 1 or even 100 lots.

Page loads only 30 first results of an announcement query. It loads quickly when there are no lots in the database, but with lots it can take around 1,5 min.

I have tried to change lazy to true and to google this problem but haven’t found much. Can anyone help with this?

Update:

After checking what query takes a lot of time, I’ve found out that the rows counting query is the cause. Query contained lots.sum condition due to default filter parameter. I have change the filter so it doesn’t have to use the set and the performance has improved.

Thanks everyone for help.

  • 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-06-04T16:14:55+00:00Added an answer on June 4, 2026 at 4:14 pm

    Try to use batch-size attribute on the many-to-many association.

    http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/performance.html#performance-fetching-batch

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

Sidebar

Related Questions

I have a problem with a page where I am trying to get colorbox
Im create this code to store page view in database, but i have problem
I have a problem on my site's login page in IE7 browser. One of
I have a problem logging onto a page and then using it with cURL.
I have a problem with rendering my html page by the same browsers in
I have a problem with using use_page_numbers config set to true in my pagination
I have a problem with a web page. The introduction of a simple <base
I have a problem with my self-made search page. There is 2 tables: **name
I have a problem with forwarding to a .jsp page. Let me describe my
I have a problem: I've add a Jquery UI drag-n-drop widget to my page,

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.