I have configured multiple data sources by following :
http://roufid.com/spring-boot-multiple-databases-configuration/
Please note that I have used same database vendor i.e., MYSQL
Data source 1: I made this as @Primary
DB: db1
Tables: table1, table2, table3
Data source 2:
DB: db2
Tables: table4
When I was trying to query on table4 (data source2: db2), I got exception like below:
SQL Error: 1146, SQLState: 42S02
Table 'db2.table4' doesn't exist
But If I changed @Primary from db1 to db2, its working.
Is anyone aware why its behaving like that ? Any configuration is missing ?