Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET, Ninject and MVC: Performance Load problems
    primarykey
    data
    text
    <p>problem description: This model works fine with one user at a time. As soon as I get multiple users at once, I get a serious of errors relating to not closing my SqlDataReader. When i turn off lazy loading like this:</p> <p>persistenceModel.Conventions.OneToManyConvention = (prop => prop.SetAttribute("lazy", "false"));</p> <p>It's fine, yet performance is slow. This uses MVC Beta 1</p> <p>Any thoughts?</p> <p>Below I have a snippet of my global ASAX as well as my SessionFactory inialization code.</p> <p>*********** THIS IS IN MY GLOBAL.ASAX ********</p> <pre><code>public class MvcApplication : NinjectHttpApplication { public static IKernel Kernel { get; set; } protected override void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //routes.IgnoreRoute("WebServices/*.asmx"); routes.MapRoute("CreateCategoryJson", "Admin/CreateCategoryJson/{categoryName}"); routes.MapRoute("User", "Admin/User/{username}", new { controller="Admin", action="user" }); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); } protected void Session_Start(object sender, EventArgs e) { if (Session["rSkillsContext"] == null) { string logonName = this.User.Identity.Name.Replace("NUSOFTCORP\\", string.Empty); rSkillsContext context = new rSkillsContext(logonName); Session.Add("rSkillsContext", context); } } protected override IKernel CreateKernel() { log4net.Config.XmlConfigurator.Configure(); Kernel = new StandardKernel(new RepositoryModule(), new AutoControllerModule(Assembly.GetExecutingAssembly()), new Log4netModule()); return Kernel; } } </code></pre> <p>***** This is my NHibernateHelper.cs ******</p> <pre><code> private ISessionFactory CreateSessionFactory() { var configuration = MsSqlConfiguration .MsSql2005 .ConnectionString.FromConnectionStringWithKey("ConnectionString") .ShowSql() .Raw("current_session_context_class", "web") .ConfigureProperties(new Configuration()); var persistenceModel = new PersistenceModel(); persistenceModel.Conventions.GetForeignKeyName = (prop =&gt; prop.Name + "ID"); persistenceModel.Conventions.GetForeignKeyNameOfParent = (prop =&gt; prop.Name + "ID"); // HACK: changed lazy loading persistenceModel.Conventions.OneToManyConvention = (prop =&gt; prop.SetAttribute("lazy", "false")); persistenceModel.addMappingsFromAssembly(Assembly.Load(Assembly.GetExecutingAssembly().FullName)); persistenceModel.Configure(configuration); return configuration.BuildSessionFactory(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload