Magento2 – Magento Falls Back to Default Database Connection

If you are getting a database connection via the Magento\Framework\App\ResourceConnection class, you should be careful when choosing how you get the connection.  You have two options:

  • Magento\Framework\App\ResourceConnection->getConnection($connectionName)
  • Magento\Framework\App\ResourceConnection->getConnectionByName($connectionName)

If you choose to “getConnection”, if the connection name that you pass in …