-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: New User, Second Level Cache question
PostPosted: Sun Aug 06, 2006 5:26 am 
Newbie

Joined: Fri Aug 04, 2006 3:16 am
Posts: 3
Hello,

I have two tables. among many ..

1. DiscountGroup (id, name, text, maxdiscount …)
2. Articles. (id, name, …, discountgroupid ) discountgroupid is a foreign key to DiscountGroup(id).

Discount Group has a 1:M relationship with the Articles (or Products) table.

DiscountGroup has about on average 3000 records
Articles have on average about 90,000 records.

The user has the authorization to modify only the articles (about 3000) he has permission to, but he needs to browse through all 90,000 records. We are planning to use the pagination feature of Hibernate and display the records to the user in a web based HTML table format. The user has the opportunity to browse through 100 records at a time and use the NEXT, PREV link to browse through the next set of records.

We will use the Hibernate pagination feature to implement the browsing feature. So we will use a similar query as below to get the next 100 records...
1) Query query = session.createQuery(“from Articles as art”);
query.setFirstResult(0);
query.setMaxResults(100);

For Articles we need to get the maxdiscount for the article, from the DiscountGroup table. So we want to lazily resolve the DiscountGroup associated with the Article
2) art.getDiscountGroup().getMaxDiscount(); and
art.getDiscountGroup().getName();

Will a query cache help in case of (1).
In such a scenario (2) will a second level cache help ?.

The ideal would be if I have about 30,000 articles in a second level cache. So browsing through the Articles will not involve a Database hit.

Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.