GC runs in the background, The memory will be released when GC occurs, but that may not be the instant you call dispose. I can only imagine 1 scenario where you would need 100+ session factories: multitenancy. There are ways to map a multitenant application with a single session factory which will also help reduce memory consumption. Another option still would be to spread the load of the application across multiple servers. Server A handles factories 1-20, Server B 21-40, etc.
another approach would be to separate your factories into separate processes and have the system call out to the UI call out to the other processes. Not sure if this would help reduce the number of session factories required. The system moves towards a distributed client/server model. The fact that you need 500-1000 factories for 30+ users, seems like a architectural problem of the system. rather than pull data using ORM from all these sources you could use ETL to populate a database and have the UI/Service communicate with that database. the ETL routines would run int he back ground periodically updating the database. Yes, disposing of a factory while there is an open session will cause exceptions to be thrown. I don't think the factory will wait for open sessions to close and prevent new sessions from opening when you call dispose. it will just dispose of them. -- 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.
