1

I have created a second database on the same server as magento database, then I've created a module that fetches data from the second database. In order to fetch data from the second database I have used the

\Magento\Framework\App\ResourceConnection

class in my constructor and then created the connection with:

$this->_resourceConnection->getConnection('customConnection');

The connection works but once in a while (at random apparently) magento breaks because of "too many connections" errors. So my question is:

  • does a new connection get created everytime I call the getConnection() method?
  • do I manually have to close the opened custom collections?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.