0

I have a project that has the following requeriments:

  1. Allow users to login in the same Web Application using different schemas following a criteria;
  2. Dynamically route the datasource against a rule - for example, users in Company A should access schema A, users in Company B should access schema B;
  3. The business logic which authenticates the user`s should be in a business component - EJB, because new applications can be added and this logic must be outside the Web Application.

I read about using Dynamic Data Source Routing. The CustomerContextHolder has a field which is ThreadLocal. Is ThreadLocal a guarantee that the user A will access the schema A following my criteria? Will the code be thread safe?

gdfbarbosa
  • 825
  • 3
  • 10
  • 21

1 Answers1

0

The way i understand is that you need multi tenency for spring along with datasource.

Probably you have have a look to spring extension which might help

https://github.com/mariofts/spring-multitenancy

Jigar Parekh
  • 6,163
  • 7
  • 44
  • 64