I’m currently working on a project where I use the data access code generated by Visual Paradigm in an ASP.NET application.
The problem I encountered was that whenever there was some kind of serious exception, NHibernate stopped working and only a restart of ASP.NET fixed the problem.
I think this was caused by the fact that NHibernate runs as a ‘session’ inside the application domain. So all users of the ASP.NET application use this same NHibernate session. If NHibernate crashes for one user, (on some occasions) it also does this for others.
When thinking of solutions :idea: I came up with the following:
- Creating an NHibernate session per page request.
- Creating an NHibernate session per user session
- Find some other solution
I’m looking for help on this topic. 1 and 2 did not really work because the application became too slow. To be precise, the instantiating of a PersistentManager takes too long. It occupies the server for a few seconds. :shock: This is unworkable in a web application.
MyProjectPersistentManager persistentManager = new MyProjectPersistentManager();
So now I have the following questions:
- Does anyone know a solution for using NHibernate generated by Visual Paradigm in ASP.NET?
- Does anyone know how to make the PersistentManager load faster?