java - Fallback Database with Hibernate -



java - Fallback Database with Hibernate -

do of know way have 2 databases running parallel? using hibernate 4 , main database postgres 9.3 - db hosted on machine application - if database downwards still have save stuff.

so first intention write csv, i'm not friend of writing stuff unordered file. want utilize fallback database (thinking of h2 database). has experience such construct?

we using spring 4 - set datasource + sessionfactory + transactionmanager - , add together name @ @transactional method utilize right manager. other ideas?

thank you!!

you can extend spring abstractroutingdatasource , configure 2 actual info sources:

a primary postgresql info source a secondary h2 info source

the application logic see 1 info source, router decide info source going switch on demand.

when primary info source downwards need instruct router pick fall-back h2 one.

java spring hibernate postgresql h2

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -