CurrentSessionContext is null when injecting NHibernate Session

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

4 Answers

0 votes
answered Feb 8, 2016 by vfplex (440 points)

Remember that NHibernate's Session Factory is the heavyweight object.
We are mainly using NHibernate to connect to the databases. The code was downloaded from NHibernate & WCF: Performance (session reuse) vs. concurrency (simultaneous requests) Tags:[wcf performance nhibernate concurrency sessionfactory] help here would be really great
commented Feb 9, 2016 by Exactly (1,320 points)
Just stumbled into this oldie
0 votes
answered Feb 11, 2016 by Unikirk (1,760 points)
Just a thought but what if you worked this problem from the opposite direction
Read more about it here How to handle Session in WinForm project? - Google Groups
commented Feb 12, 2016 by tbb9734 (1,080 points)
Code example borrowed heavily from here
+1 vote
answered Feb 18, 2016 by Fgv7358Slea (610 points)
This issue happens if this project is being used by another project. Check if this helps NHibernate & WCF: Performance (session reuse) vs ... across this as part of our regular project
0 votes
answered Feb 20, 2016 by Quartararo (720 points)
Using float will lead to unpredictable rounded values in most situations

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!