Not if you give each session factory a unique name. On Wed, Feb 18, 2009 at 1:17 AM, Robert Byrne <[email protected]> wrote:
> > That was my first thought. Since each tenants factory points toward > the same database and they will reference common tables, could this > cause any problems with session factory level caching. Are there any > assumptions that there will only be one session factory per database > at any one time (each session factory is thread safe, but what about > multiple threads on multiple factories?) > > On Feb 18, 5:42 am, Ayende Rahien <[email protected]> wrote: > > You should have a session factory for each tenant. > > > > On Wed, Feb 18, 2009 at 12:34 AM, Robert Byrne <[email protected]> wrote: > > > > > I hope the title is clear on this one. Again, looking to see if anyone > > > has any feedback on the following. > > > > > I'd like to use NHibernate to work with a dynamic database schema. > > > I've already figured out how to build up the mapping for the dynamic > > > entities thanks to some digging around the source and feedback from > > > Fabio. > > > > > The next question is - is there a way to process the mapping for a new > > > entity, or modify/replace the mapping for an existing one without > > > rebuilding the entire session factory? The session factory is > > > immutable, by design, so sneakily modifying it after creation feels > > > wrong, but rebuilding the singleton session factory after every change > > > to the schema by any tenant (a frequent occurrence in this > > > application) isn't a realistic option for performance reasons. > > > > > I thought of maintaining a pool of session factories, or one factory > > > per tenant, to isolate the overhead of rebuilding, but as they are all > > > pointing toward the same database wont that cause collisions with > > > caching etc? > > > > > I realize that NHibernate is primarily geared towards predefined > > > mapping of classes to well known schema, but I'd like to believe that > > > theres a way to have the best of both worlds here. > > > > > Any ideas? > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
