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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:22:30+00:00 2026-05-20T14:22:30+00:00

In the project my team is working on, there is a windows service which

  • 0

In the project my team is working on, there is a windows service which iterates through all the entities in a certain table, and updates some of their fields based on some rules we defined. We use NHibernate as our ORM tool. Currently, we open one session and one transaction for the entire proccess, which means the transaction is commited after all the entities have been proccessed. I think this approach isn’t good, and I wanted to hear some more opinios:
Should we keep our current way of managing the session, Or should move to a different approach?

One option I thought about is opening a transaction per entity, and another suggestion was to open a new session for each entity.
What approach you think will work best?

  • 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-20T14:22:30+00:00Added an answer on May 20, 2026 at 2:22 pm

    There isn’t a single way to do it; it all depends on the specific cases.

    In the app I’m working on, I have examples of the three approaches, and there’s a reason for choosing each one. For example:

    • The whole process must have transactional atomicity: use a single transaction
    • The process has a lot of common data, but each record in the “master” table can be considered a unit of work: use a single session, multiple transactions
    • Processing each record in the master table should be independent from the others (including error handling): use a session per record
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our team is currently working on a large project which makes heavy use of
A project I'm working on is suffering from some minor performance issues. Our team
I am currently working on an ASP.NET MVC project. Some developers on the team
My team is currently working on windows forms project using VB.NET. We are curently
My team is working on an Android project which consists of several Android applications
Working on a project which uses Jquery(1.6) Tabs, works all good but wondering if
My team working in a project using Winforms application(c#) & MSSQL 2005 as database.
My team working on a php/MySQL website for a school project. I have a
In the project my team is currently working on, we're modifying a commercial PHP
I am currently working on a rather large project with a team distributed across

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.