All, I'm using an "ambient context" pattern where my code doesn't explictly open or close a session. It simply adds to a repository (wrapping NH) and when it persists the repository, the persist method writes data out within a Transaction Scope.
The first time any code talks the repository, it will automatically open an NH session on that thread. Similar concept to the Open Session In View pattern. My question is that we've started doing a lot of multi-threaded programming so my pattern is opening sessions for each thread. I'm ok with this as I store a session against the thread data. What I'm concerned about is that the programmer is not explictly closing the session. They would just finish the thread and let it get terminated by .NET. So, what will happen to the sessions in NH? Are they automatically garbage collected (as nothing references them as the thread that did reference them has terminated) or does NH somehow keep track of the session in its factory, even though it isn't being used. Have I got a potential memory leak? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
