André-John Mas wrote:I have two databases that I need to access from my application. They are both part of the same MySQL instance. While I can connect to the database that I declared in the connection, I am not sure what they best way of accessing the second database is. Can anyone advise me on the best way to do this?
As Hibernate suggests that
SessionFactory instances are not lightweight and typically one instance is created for the whole application. If the application accesses multiple databases, it needs one per database.
You need to create two SessionFactory for each database.