Jhipster上的两个MySQL数据库 [英] Two MySQL Database on Jhipster
问题描述
我正在使用jHipster,它很棒,因为大多数样板代码是自动生成的。
I am using jHipster and it is great as most of the boiler-plate Java code is automatically generated.
在我的应用程序中,我需要两个MySQL数据库。我该如何配置它们?我应该为两个不同的模式有两个不同的数据库配置文件吗?
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?
此外,jHipster使用Liquibase,那么如何更改DatabaseConfiguration类?
Also, jHipster uses Liquibase, so how do I change my DatabaseConfiguration class?
推荐答案
- 您将需要配置2个数据源,2个Hibernate会话,2个缓存实例......这将是相当的复杂:首先从数据源开始(显然!)。
- 请注意,事务在两个数据库之间不起作用,因此这会导致一些有趣的错误: - )
我更喜欢的另一个解决方案是使用类似于Oracle DB Link的东西。这将解决所有这些问题,并且更容易处理。
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.
这篇关于Jhipster上的两个MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!