Reputation: 686
I am using jHipster and it is great as most of the boiler-plate Java code is automatically generated.
In my application, I need two MySQL databases. How do I configure them? Should I have two different database config files for the two different schemas?
Also, jHipster uses Liquibase, so how do I change my DatabaseConfiguration class?
Upvotes: 2
Views: 1597
Reputation: 4444
I'm not sure, if you talk about spring, but since you added the spring tag, I assume you do.
As far as I see, the basic question is, wether you need an XA-transaction or not (update both databases within the same transaction). If you do, then you simply define your datasources with an appropriate MySql XA-Datasource and bind them to the same transactionmanger (which of course has to support XA-transactions).
If you do this configuration in one or more spring-config-xml files (or java classes, if you prefer annotation based spring configuration) is up to you.
Upvotes: 0
Reputation: 3688
Another solution, which I would prefer, is to use something similar to Oracle DB Link. That would solve all those problems and be much easier to work on.
Upvotes: 2