Working on Aspneweb Api2, currentSessionContext is null when injecting NHibernate Session


+2 votes
asked Feb 4, 2016 by space (1,170 points)
I am trying to set up session management back-bone for my web-api 2 based application.

3 Answers

+1 vote
answered Feb 13, 2016 by In_this (1,090 points)

Remember that NHibernate's Session Factory is the heavyweight object.
We are mainly using NHibernate to connect to the databases.

Credit for this goes to NHibernate & WCF: Performance (session reuse) vs. concurrency (simultaneous requests) Tags:[wcf performance nhibernate concurrency sessionfactory]
commented Feb 14, 2016 by gur8502the (1,440 points)
Would work for unequal row size
commented Feb 14, 2016 by salera (970 points)
There are a couple of ways that you can handle a situation like this one. A good discussion of it is available here
+1 vote
answered Feb 27, 2016 by well_3926 (870 points)
That you have to have design patterns in your code
In fact, DynamicProxy: An Elegant Solution for Session/Transaction ... works, but only after I have logged in to my account
+1 vote
answered Mar 15, 2016 by Gooding (320 points)
This implementation should work. More info on spreads

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!







...