-->
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: Multiple select queries issue - with FetchMode.SELECT
PostPosted: Thu Jun 22, 2006 11:19 am 
Newbie

Joined: Thu Jun 22, 2006 9:41 am
Posts: 2
In our application, where we are using 'org.hibernate.Criteria' to fetch records.

Here is a brief description of the object relationships:
1) A is the parent object
2) B, C, D are children of A
3) E is child of B

For A.C, the 'FetchMode.JOIN' is specified.
For A.B and A.D, the 'FetchMode.SELECT' is specified.
For B.E, the 'FetchMode.SELECT' is specified.

Scenario 1:
The count of instances for A is 1. i.e. in the IN clause of the SQL to load A, only one value is passed.
250 Bs and Ds exist for that A. And 250 Es exist with 1-to-1 multiplicity with B.
Here we observed that only one SQL is being fired per entity (A join with C, B, D, E)

Scenario 2 (The problem case):
The count of instances for A is 60. i.e. in the IN clause of the SQL to load A, 60 values are passed.
60 Bs and Ds exist with 1-to-1 multiplicity with A. And 250 Es exist with 1-to-1 multiplicity with B.
Here we observed that only one SQL is being fired for A join with C.
But 4 SQLs were being fired for B, D and E.
There was a consistent pattern of the first SQL having 31 values in the IN clause , the second having 15 , third having 10 and the last having 4.

We have 'hibernate.jdbc.fetch_size' as 200 in the hibernate.cfg.xml and the batch-size is set as 250
for all A, B, C, D and E.

The hibernate version is 3.1.1 and Database used is Oracle 9.2.0.6.0.

Can anyone help us in identifying why the query is split up in the second scenario?


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.