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

  • Home
  • SEARCH
  • 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 8440989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:26:55+00:00 2026-06-10T08:26:55+00:00

I still have difficulties with some NHibernate terms so please bear with me. I

  • 0

I still have difficulties with some NHibernate terms so please bear with me.

I am building a POCO class based off a web submission. The web user will be changing some scalar properties. The POCO will already be persisted in the database. I want to save changes to the POCO to the database, collect the child objects (which should be unchanged) and return the POCO’s graph so I can send feedback back to the user.

What is the proper way to do this? Is this “detached”? What is the appropriate method for connecting the child collection? Can it be done in one database batch?

  • 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-06-10T08:26:56+00:00Added an answer on June 10, 2026 at 8:26 am
    1. Persisting changes to your object is easily done using Session.Update().
    2. retrieving child collection is done either implicitly (by accessing the collection property which causes nHibernate to fetch it from the DB), or explicitly, using the Fetch() method.
      For example- var users = QueryOver<User>().Where(u => u.Age > 18).Fetch(u => u.Children).Eager.

    In general, for a web app, I would recommend reading a little about the ‘session per request’ pattern. (this example is a little bit of an overkill for my taste, but it explains the concept quite well).
    Also don’t forget to always use transactions.

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

Sidebar

Related Questions

Some web apps still have the old icon resolutions for iPhone 3GS and before.
I've done some web-based projects, and most of the difficulties I've met with (questions,
I'm still new to Objective-C and having some difficulties trying to figure out the
I have some difficulties implementing the repository and service pattern in my RavenDB project.
I am developing a GUI application in Qt, and I have some difficulties embedding
We still have to use Weblogic 8.1.6. There are some libraries packaged with the
I'm trying to create a Textmate snippet, but have run into some difficulties. Basically,
I have difficulties with using the this keyword in a MooTools (1.3) class. The
I have some difficulties getting my pipes work. I have the following code: /*
I still have some problems with jQuery. If I have html like this: <form

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.