I have 2 databases (let's call them User
and Stuff
), connected to a single Spring-java-web-application via 2 different EntityManager
. Stuff
has read-replica associated with it.
When I'm using com.mysql.jdbc.Driver
to connect to both the dbs, it's working fine and the app is able to connect with both the dbs. But when I'm using com.mysql.jdbc.ReplicationDriver
to connect to Stuff
(to use read-replica) and com.mysql.jdbc.Driver
to connect to User
, the app is not able to connect to User
and it gives:
Connections could not be acquired from the underlying database!
Can anyone suggest, how to use 2 EntityManager
with read-replica?