Hi
I use my own role provider in my nhibernate application. I have a repository that I call whenever I want to access an nhibernate session.
So, when my role provider initializes itself
public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config) {
base.Initialize(name, config);
Repository = new Repository();
}
Then i redefine
public override string[] GetRolesForUser(string username) {
var users = Repository.QueryAll<Users>();
// Then I filter, etc.
}
But when this function is called, I always get an error that the NHibernate session is closed. I debugged the source code of nhibernate, and it turns out that in this session there is another guide that has a session in my controllers (I also use ASP.NET MVC). And this particular session is closed by the time I come here. I do not know who closes it. I know that it starts when the application starts and only then.
- , ?
- Nhibernate , .