-->
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.  [ 2 posts ] 
Author Message
 Post subject: Cache, batch size , multiple queries
PostPosted: Fri Sep 08, 2006 3:39 pm 
Newbie

Joined: Mon Mar 27, 2006 12:35 pm
Posts: 4
Hi

I have a one to many relationship R1 between two tables T1 & T2 ( Classes C1 & C2 )and i have mapped the relationship with list element.
I have enabled collection cache for R1 and class cache for C2.
I have batch-size attribute set on collection R1 and class C2 class.
When I try to load C1 & C2 instances ( which have lazy="false" )
-the first time instances of C2 are loaded, they are loaded in batch which is desired,
-subsequent attempts cause seperate queries being issued to load C2 instances one for each instance of C1.

I have query cache enabled as well.

I tried different collection elements as well ( list, set, bag ) neither helped.

Since the number of instances of C2 are huge, the transaction is timing out. Why is batch-size behaving correctly the first time but cause the n+1 selects afterwards? Any help would be appreciated.

Thanks
Sreeram


Top
 Profile  
 
 Post subject: Batch and query cache
PostPosted: Mon Sep 11, 2006 10:35 am 
Newbie

Joined: Mon Mar 27, 2006 12:35 pm
Posts: 4
Does any one else see this behavior where

with batch-size attribute enabled, the first time records are being retrieved in batch as desired, but subsequent attempts ( probably after cache time out ) are causing individual sql elements being triggered?


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

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.