• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

How do you implement a clustered database?

 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My database server (h2) does not reliably support clustering yet; but I need to insure data redundancy. Can I mess up with Hibernate connections in such a way that every database connection would in fact be two connections to two different databases on two computers, seamlessly for the rest of the application? I only care about writes; reads can go to one database as far as I am concerned.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well you could use Hibernate Shards project possibly.

But with Hibernate a Connection factory is one to one to a SessionFactory. So to point to two different databases you need two different SessionFactories.

Mark
 
Jane Jukowsky
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if I supply my own ConnectionFactory, is that very convoluted?
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jane Dodo wrote:What if I supply my own ConnectionFactory, is that very convoluted?



a single Hibernate SessionFactory can only communicate with a single database.

Mark
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic