• Post Reply Bookmark Topic Watch Topic
  • New Topic

Two SessionFactory Objects

 
abheeshek reddy
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can we connect to two databases at a time by using Hibernate?

Are you covering this topic in your book?


Thanks
abhee
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You can do it with two SessionFactories. Assuming you know where the dividing line is, your can switch accordingly in you DAO layer.
 
Emmanuel Bernard
author
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cna also have a look at Hibernate Shards that does horizontal partitioning.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!