I haven’t found a question on this topic so I’ll ask. I’ve never actually tackled something which uses more than one data source. One example would be ETL which requires two data sources. How could such an application be designed?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Two data sources, two separate names. Inject each one by their respective bean IDs.
You’d want to have a single DAO, but two instances of it – each with their own data source. One would SELECT from the source, the other would INSERT into the target.
A better way might be to forego Spring and just use bulk transfer mechanisms built into the databases.