Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NH-3087 - Add support for multi tenancy #974

Closed
nhibernate-bot opened this issue Oct 12, 2017 · 6 comments · Fixed by #2108
Closed

NH-3087 - Add support for multi tenancy #974

nhibernate-bot opened this issue Oct 12, 2017 · 6 comments · Fixed by #2108

Comments

@nhibernate-bot
Copy link
Collaborator

nhibernate-bot commented Oct 12, 2017

Paul White created an issue — 13th March 2012, 21:19:19:

Hibernate now supports multi tenancy, documented here: http://docs.jboss.org/hibernate/core/4.1/devguide/en-US/html/ch16.html#d5e4642

The feature was tracked in Jira here: https://hibernate.atlassian.net/browse/HHH-5697
Related commits here

Hopefully something similar can be implemented for NHibernate


Paul White added a comment — 14th March 2012, 15:03:24:

I have forked NHibernate Core to start work on this: https://github.com/IronsUK/nhibernate-core


Paul White added a comment — 17th April 2012, 8:07:57:

I created a pull request for some initial work around this: #91


Oskar Berggren added a comment — 26th May 2012, 20:26:10:

Pull request 91 partially merged. The remained cleaned up and available at https://github.com/oskarb/nhibernate-core/tree/NH-3087-prelim.

@devalot76
Copy link

Hi,
any news about this?

@fredericDelaporte
Copy link
Member

As far as I know, no one works on this. It is up to grab.

@devalot76
Copy link

devalot76 commented Mar 4, 2019

As far as I know, no one works on this. It is up to grab.

And I honestly struggle to understand why: has anyone ever heard of SaaS? Has anyone ever had the need to develop this type of applications?

@gliljas
Copy link
Member

gliljas commented Mar 4, 2019

And I honestly struggle to understand why: has anyone ever heard of SaaS? Has anyone ever had the need to develop this type of applications?

Absolutely. We do it on quite a large scale, but configure separate session factories for each tenant.

@devalot76
Copy link

And I honestly struggle to understand why: has anyone ever heard of SaaS? Has anyone ever had the need to develop this type of applications?

Absolutely. We do it on quite a large scale, but configure separate session factories for each tenant.

Can you share some code, please? I've heared that this approach takes a lot of memory; in addition, session factory creation is an expensive operations: how does this impact the performance? Thank you.

@gliljas
Copy link
Member

gliljas commented Mar 5, 2019

There's really nothing to it. We cache the "shared" Configuration, augment it with tenant specifics and just create sessionfactories which are resolved using IoC.

Yes, it consumes memory. Yes, factory creation is expensive. It's really not a problem for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants