Hi, A session factory is thread safe once built. Thread safety is hard to get right with mutable objects. And thread safe mutability incurs using locks, which hurts performances.
On Thursday, August 22, 2024 at 10:20:53 PM UTC+2 [email protected] wrote: > Hello Everyone, > > I hope you're all doing well. > > I'm currently working with NHibernate and have been reviewing some of its > code on GitHub. I noticed that every time we add or modify mappers in the > configuration, it seems necessary to rebuild the SessionFactory. > > Why can't we simply update the newly added mappers in the existing > SessionFactory? Is it mandatory to rebuild the SessionFactory each time? > What is the rationale behind maintaining the SessionFactory as immutable? > If there are any vulnerabilities or risks with this approach, could you > provide example scenarios? > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nhusers/ac065865-2053-4b76-aa33-c86b68957571n%40googlegroups.com.
