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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:32:42+00:00 2026-05-15T07:32:42+00:00

We are having a few problems understanding how best to use NHibernate. We typically

  • 0

We are having a few problems understanding how best to use NHibernate. We typically have a relatively large number of quite small (in terms of number of tables) SQL Server databases rather than one database with a lot of objects.

We are looking at various options for handling multiple session factories and probably have this under control. However we are not sure how we would wrap all calls in a single transaction. Using hand-rolled data access you would just wrap it all in a TransactionScope but we are a little reluctant to do this with NHibernate as it seems to like to handle all its own Transactions.

Using multiple databases with shared transactions seems like the sort of thing lots of people would want to do with NHibernate.

Are we just barking up the wrong tree entirely?

  • 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-15T07:32:43+00:00Added an answer on May 15, 2026 at 7:32 am

    You can safely use TransactionScope. But you have to open NHibernate transactions too.

    Example:

    using (var ts = new TransactionScope())
    using (var session1 = sessionFactory1.OpenSession())
    using (var tx1 = session1.BeginTransaction())
    using (var session2 = sessionFactory2.OpenSession())
    using (var tx2 = session2.BeginTransaction())
    {
        //Do work...
        tx1.Commit();
        tx2.Commit();
        ts.Complete();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have built a booking system, and I am having a few problems
I am having quite a few problems saving a C# control to a bitmap
Having read up on quite a few articles on Artificial Life (A subject I
I'm having a huge problem in understanding Membership with MVC. We have in our
Having a few problems with output buffering. Mainly, I'm trying to run output buffering
I'm having a few problems trying to position some div s in my website
I am having a few problems loading a table into the designer. I get
Im having a few problems with the form_dropdown function in CodeIgniter .... My application
I am having a few problems with regex in C#. I require a string
Hi i am having some problems retreiving data from the datastore... I have a

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.