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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:16:27+00:00 2026-05-31T23:16:27+00:00

I am using nhibernate and i have code like this in the mapping area:

  • 0

I am using nhibernate and i have code like this in the mapping area:

  HasMany(x => x.People).AsBag().Inverse().Cascade.AllDeleteOrphan().Fetch.Select().BatchSize(80); 
  HasMany(x => x.Clothes).AsBag().Inverse().Cascade.AllDeleteOrphan().Fetch.Select().BatchSize(150);

My question is, how do i figure out what the best value to put in .BatchSize ? Should i simply put a high number. Is there a downside to putting a number too high?

  • 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-05-31T23:16:28+00:00Added an answer on May 31, 2026 at 11:16 pm

    There isn’t a single answer to this question.

    The only way to determine what works best is profiling the app in production, with real users doing real things. This is time-consuming, so it’s probably something you’ll do only if you find the app is slow

    The risk of a too-high number is that a query with a lot of parameters retrieving a range of records for each one might be harder on the DB than a few smaller queries.

    Also, if you are not using all the collections that you have referenced (for example, if you retrieved a list of PostCategories, but you only show the Posts for one of them), you might be loading a lot of data unnecessarily.

    My advice is to start with something like 20 or 50(*) and make it higher only if you often find yourself needing more than twice that number of collections loaded concurrently.

    (*): yes, I did pull those numbers off my butt. 50 is what I currently use by default.

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

Sidebar

Related Questions

Using NHibernate.Mapping.Attributes, I have a entity class with something like: [Class] public class EntityA
I have 2 mappings like this: <hibernate-mapping> <class name=A table=A> <id name=code column=aCode type=integer>
I have a mapping that looks like this: <class name=Record> <map name=Values> <key column=RecordFK/>
I am using NHibernate and have a cache region specified in my NHibernate configuration:
I am using NHibernate as my ORM solution and have a need for a
I have a ASP.NET MVC application using NHibernate and the application runs fine when
Does anyone have any good sources of information of using NHibernate with Sql Azure
I'm using NHibernate 2.1.2 and Spring 1.3 I have two Text columns (blobs) in
How can I have the property of a property set using NHibernate? Here is
I have a class that is mapped to a table using NHibernate. The problem

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.