Hello, I've a design question involving hibernate and 2 databases. Let me introduce the scenario first so you can get a better picture of what my doubt is about.
Scenario: I've an application with spring and hibernate. This application uses a database (app_db), this is the main db where the application map the entities against using Hibernate (so far a normal application). Now I've been requested to also connect to a second db (second_db), which is a db used by another app in the company, I just need to get some information from there, to be precisely this second_db has the "employee" table that will match against my Employee class. Also I'll only have read-only access to this second_db (I just need to get the data, no need to modify it).So, that's the scenario. My question is whether there is any drawback configuring a second hibernateFactory for this "second_db". I've been told that is a bad design using a ORM to connect/map entities from a db that is not part of my application (like the "second_db" I talked about) and it should be addressed by native JDBC.
Any opinion will be helpfull. Thanks !
|