Hi all, I've been using FluentNHibernate for some simple projects and had a question about SessionSource.
SessionSource has an instance of SessionFactory within it. I was having my concrete repository objects take an ISessionSource in the constructor and then pushing in a SessionSource per request in the actual usage of the repo. This worked for small projects but I noticed when I used it in a larger web app that the app began leaking memory. My brief research on that topic indicated that it was wrong to create a SessionFactory per request and that wrapping its creation as a singleton was the correct way to go -- the codeCampServer code has an example of that. I wrote a wrapper around SessionSource called SessionSourceBuilder that handles making an internal SessionSource a singleton. My question is this: is this the "correct" answer to the problem, or should SessionSource take on the responsibility of having maintaining the singleton construct around its own internal SessionFactory ( make it static ). Right now I am treating the SessionSource as though it were the factory itself but it doesn't seem like that was the intention, but that feels kind of like a hack and I'm curious if I'm on the right track with this or if SessionSource was meant to serve this purpose. Thanks, -Sean --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---