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

Add setMultiTenantConnectionProvider to org.springframework.orm.hibernate5.LocalSessionFactoryBean [SPR-14072] #18644

Closed
spring-projects-issues opened this issue Mar 19, 2016 · 3 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Mar 19, 2016

Menachem Rath opened SPR-14072 and commented

#15449 added the methods setMultiTenantConnectionProvider and setCurrentTenantIdentifierResolver methods to LocalSessionFactoryBean in org.springframework.orm.hibernate4

In org.springframework.orm.hibernate5.LocalSessionFactoryBean only the setCurrentTenantIdentifierResolver exists, and it doesn't appear t be working.

Looking at the Hibernate documentation for:

I don't see a difference in the behavior of multi tenant.


Affects: 4.2.5

Reference URL: http://docs.jboss.org/hibernate/orm/5.1/userguide/html_single/Hibernate_User_Guide.html#_multitenantconnectionprovider

Issue Links:

Referenced from: commits 5f64064

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

The reason is simply that, for whatever reason, Hibernate 5 does provide an explicit setCurrentTenantIdentifierResolver method on its Configuration class but not a corresponding setMultiTenantConnectionProvider. I'll see what we can do here, possibly using the properties-based approach along the lines of what we do for Hibernate 4... just for this particular setting.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've introduced this for Spring Framework 4.3 now, as a setMultiTenantConnectionProvider method on both LocalSessionFactoryBuilder and LocalSessionFactoryBean. Since those classes have been reworked for 4.3 already, let's consider this feature as 4.3+ as well. After all, it drags a rather involved new Hibernate SPI dependency into those classes which might cause side effects.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Menachem Rath commented

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants