![]() |
VOOZH | about |
Software Engineer at Unemployed
Los Palacios y Villafranca, ES
Joined Sep 2013
https://www.linkedin.com/in/jos%C3%A9-manuel-garc%C3%ADa-maestre-a6917226/
Software Engineer
Stats
| Reputation: | 250 |
| Pageviews: | 435.6K |
| Articles: | 4 |
| Comments: | 13 |
Comments
Apr 25, 2018 · Jose Manuel García Maestre
Hello Anand, I have worked in a private project which I was allowed to shared part of the code so I don't have the ApplicationContext.xml. However you can go to this post https://sunitkatkar.blogspot.com/2018/04/building-saas-style-multi-tenant-web.html that may be useful for you, it uses spring boot instead and included his project in github so you can try to translate to xml in applicationContext.xml. I hope you get to fix it :)
Mar 12, 2018 · Jose Manuel García Maestre
Maybe I can help you. Can you copy the error?
Oct 17, 2017 · Jose Manuel García Maestre
In this case it is a custom implementation. DataSourceLookup is a Spring interface that allows us to look up DataSources by name, we chose it since we want to find DataSource by TenantId.
Check the second part, first topic https://dzone.com/articles/multi-tenancy-using-jpa-spring-and-hibernate-part-2
Aug 10, 2017 · Jose Manuel García Maestre
oh yes, thanks very much, any new help is welcome. I had a conflict with Tomcat environment once :), with some versions of tomcat worked and others not so I will take a look to your post for sure.
Jun 07, 2017 · Vishnu Garg
I think it may be interesting for IA applications somehow. For example some IA able to build an app.
Jun 07, 2017 · Jose Manuel García Maestre
Thanks for your interest, I am afraid that I cannot tell you an specific date, I have been busy lately but as soon as I have some time I will go for it. These topics (Schema export and tenantId in sessions) are custom implementations, everyone implement it in different ways. So you can try to do it in your own way if it is for a project.
Dec 05, 2016 · Jose Manuel García Maestre
Apologies if there was a misunderstanding, I tried to be as clear as I could that this was a solution that using Spring, JPA and Hibernate together. I explained how Hibernate works in the part of the blog that talks about session, sessionFactory. There is not need to use Session and SessionFactory since is created by JPA using Hibernate.
Since JPA is in itself using Hibernate, so you could apply similar logic to different JPA implementations.
Dec 02, 2016 · Jose Manuel García Maestre
Your question has a lot of ways to be implemented, I will post an article about "DataSourceLookup implementation for multi-tenancy" in the ricston blog firstly (www.ricston.com/blog/) during the next month.
Dec 02, 2016 · Jose Manuel García Maestre
Yes, it is possible, I used bonecp, you can define a C3P0 DataSource as spring Bean per tenant, don't forget to define one as default datasource to use when not tenant is selected (I called defaultDataSource). If you see the class MultiTenantConnectionProviderImpl I used a MapDataSourceLookup where I stored all the DataSources by tenantId.
Dec 02, 2016 · Jose Manuel García Maestre
As far as I can tell, on one hand Xml based configuration is more human-readable and therefore you can find the relationship between beans easier than java but in the other hand, Java allows more flexibility using code and you don't get errors when you mistake in a class name.
Personally If I have to choose, I prefer flexibility and posibilities that code offers than human-readable xml, according to documents that I found, it seems that Spring is pushing to that.
Overall I would prefer visual scripting with coding flexibility to manage beans if that existed.
Dec 02, 2016 · Jose Manuel García Maestre
Do you mean the configuration based on java? I made a snippet in gist that can be usefull. I didn't test it but it should be similar to this.
https://gist.github.com/jose-mgmaestre/5d9dcab622f167006863e22a95a7c0cb
Dec 01, 2016 · Jose Manuel García Maestre
Yes, I encourage to the people to use Java configuration since it's more flexible. I share a gist that I created with the java based configuration, it may be useful to someone. (I didn't test it, so don't hesitate to reply me back if I mistaked in some point)
https://gist.github.com/jose-mgmaestre/5d9dcab622f167006863e22a95a7c0cb
Dec 01, 2016 · Jose Manuel García Maestre
Good question, I applied Multitenancy in an old project and before in Spring a lot of the configuration was based on XML. Also I found a lot of examples in the configuration based on java using @Configuration tag but none in XML so I finally decided to do the post with XML.
User has been successfully modified
Failed to modify user
ADVERTISE
CONTRIBUTE ON DZONE
LEGAL
CONTACT US
Let's be friends: