VOOZH about

URL: https://dzone.com/users/1184241/jose.mgmaestre.html

⇱ Jose Manuel García Maestre - DZone Member


Jose Manuel García Maestre

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/

About

Software Engineer

Stats

Reputation: 250
Pageviews: 435.6K
Articles: 4
Comments: 13

Articles

Dagger 2 Tutorial: Dependency Injection Made Easy
Need help with dependencies and injections in Java? Check out this tutorial on how to use dependency injections in Dagger 2.
July 13, 2018
· 55,717 Views · 7 Likes
Solving Dependency Conflicts in Maven
The more libraries you pull in, the more likely you are to hit conflicting dependencies. Here are a couple of ways to resolve them when using Maven.
Updated August 18, 2017
· 237,870 Views · 43 Likes
Multi-Tenancy Using JPA, Spring, and Hibernate (Part 2)
If you want to support multi-tenancy with Spring in your stack, you should know how Spring actually knows the tenants, then dive right in.
February 21, 2017
· 33,069 Views · 9 Likes
Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)
Learn how you can make your application act like multiple, independent apps by implementing multi-tenancy and keeping your data accessible by the tenants.
December 1, 2016
· 91,622 Views · 56 Likes

Comments

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 2)

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 :)

Solving Dependency Conflicts in Maven

Mar 12, 2018 · Jose Manuel García Maestre

Maybe I can help you. Can you copy the error?

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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

Solving Dependency Conflicts in Maven

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.

All About the Singleton

Jun 07, 2017 · Vishnu Garg

I think it may be interesting for IA applications somehow. For example some IA able to build an app.

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 2)

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.

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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.

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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.

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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.

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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.

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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


Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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

Multi-Tenancy Using JPA, Spring, and Hibernate (Part 1)

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

Let's be friends: