c# 4.0 - What CurrentSessionContext to use with Tasks -


when using currentsessioncontext tasks, context should used?

i have been using threadstatic context, , warnings nhprof same session being used in multiple threads.

if using threadstatic should fine. should use different session per thread if used properly. typically use following use session context:

// open session if there not 1 opened yet. if (!currentsessioncontext.hasbind(sessionfactory)) {     currentsessioncontext.bind(sessionfactory.opensession()); }  var currentsession = sessionfactory.getcurrentsession(); 

Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

collision detection - C++ library for mesh to mesh intersection: what is available? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -