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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:40:59+00:00 2026-05-12T00:40:59+00:00

I am using NHibernate to as the Data Access layer for my ASP.NET MVC

  • 0

I am using NHibernate to as the Data Access layer for my ASP.NET MVC application. I am also using Structure Map as an IoC container. I have configured Structre map to create a session factory as a singleton and create sessions on a per request basis (InstanceScope.Hybrid). I am able to do basic CRUD operations just fine.

Now, I have a background process running every 30 seconds, which uses a few repositories(which in turn use sessions). And this background process is unable to pick up the new data for some reason. Maybe I am missing a simple thing. I tried googling but was unable to find anything useful. It would really help me if someone pointed me in the right direction.

EDIT:

I am not sure if I have the second level cache enabled, I am a newbie with NHibernate, My hibernate configuration file is pasted below.

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory>
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
    <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
    <property name="connection.connection_string">Data Source=.\SQLEXPRESS;Initial Catalog=Map.db;Integrated Security=True</property>
    <property name="show_sql">true</property>
    <mapping assembly="Infrastructure"/>
  </session-factory>
</hibernate-configuration>

The main thing I want to know is, if there is a design/design pattern which is already used in typical web applications using NHibernate. And would using Stateless sessions solve the problem, if my database settings are updated from a different app?

  • 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-12T00:40:59+00:00Added an answer on May 12, 2026 at 12:40 am

    I solved this problem by creating a separate console application just for this purpose. Wasn’t an elegant solution, but it still worked. Thanks for all your answers.

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

Sidebar

Related Questions

I'm using custom asp.net membership provider with underlaying nhibernate data access code, which is
We are using Nhibernate as our data access layer. We have a table of
I have a basic MVC application that is using NHibernate for OR/M and data
I needed to create an application using Struts2 as MVC,Hibernate for data access and
I am using nhibernate and mvc3 in asp.net I'm trying to add data into
I have a WPF Application using Fluent NHibernate 1.0 RTM and System.Data.SQLite 1.0.65 that
I'm creating a multi-tenant ASP.NET application using NHibernate (shared schema). I had intended to
I’m using NHibernate for data access, but accessing it through a façade layer. This
I have a C# .NET 3.5 data access layer that is a plain ADO.NET
we are using .net mvc and sqlserver db. EDIT We are also using NHibernate

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.