Need to handle multiple databases; How to design with Spring?
I have a J2EE Web application with Servlets and Java ServerPages. Beside this I have a in-house developed API for certain services built using Hibernate and Spring with POJO's and some EJB.
There are 8 databases which will be used by the web application. I have heard that multiple datasources with Spring is hard to design around. Considering that I have no choice not to use Spring or Hibernate as the API's are using it.
Anyone have a good design spesification for how to handle multiple datasources. The datasource(database) will be chosen by the user in the web application.
I need to have the hibernateSessionFactory bean use the datasource which will be chosen by the user. I could certainly create several datasource beans in the Application Context xml file, but the problem is how do I get the chosen one to hibernateSessionFactoru