-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: 2 databases question design
PostPosted: Fri Apr 05, 2013 9:36 am 
Newbie

Joined: Fri Apr 05, 2013 9:18 am
Posts: 1
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 !


Top
 Profile  
 
 Post subject: Re: 2 databases question design
PostPosted: Tue Apr 09, 2013 7:57 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Surely with accessing the second database with jdbc directly is more fast, than building a second session factory and working with hibernate only.
On the other side coding jdbc-code means programming at very low level.
In my opinion it's just a matter of taste.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.