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 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 have created a Data Access Layer using .NET. Everywhere that I update a
I'm currently working on an ASP.NET MVC project using NHibernate and I need to
I'm creating a multi-tenant ASP.NET application using NHibernate (shared schema). I had intended to
Given: I'm trying to create a REST API using ASP.NET MVC . I'm using
When using ASP.net webforms my usual solution would have following type of setup -
I'm using NHibernate on a project and I need to do data auditing. I
We are using Hibernate 3.1 with Spring MVC 2.0. Our problem occurs when data
Using NHibernate.Mapping.Attributes, I have a entity class with something like: [Class] public class EntityA
I am using NHibernate as my ORM solution and have a need for a
I use NHibernate for my dataacess, and for awhile not I've been using SQLite

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.