When we use QueryOver with Future and Cacheable, the batch-size seems to be 
ignored in the mapping file.

For example, we have a simple entity mapped as follows:

<class name="Cat" batch-size="50">

We then query the entity as follows:

session.QueryOver<Cat>()
    .Cacheable()
    .List();

Using NHibernate Profile, we can see 29 rows being returned in a single SQL 
statement. Executing the same query again sees a cache hit on the query and 
then 2 batch selects of 25 rows and 4 rows. Why isn't it observing the 
batch size of 50 in the mapping file?

If we then add Future to the query and repeat the same test:

session.QueryOver<Cat>()
    .Cacheable()
    .Future()
    .ToList();

We see the same result on the first query with 29 rows being returned in a 
single SQL statement. A second query however, sees a cache hit on the query 
but then 29 individual selects for each Cat rather than batched queries.

Is this a bug or is there something that we are doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to