Support the ongoing development of Laravel.io →
Testing Laravel Database
Last updated 2 years ago.
0

I tried also use 'options' => [ PDO::ATTR_PERSISTENT => true ] in database config. I had 1 connection but also had error PDOException: There is already an active transaction

0

Too many connection errors are your DB server refusing not your code.

Two ways I would combat this change the configuration on your DB server to allow more connections or go through all the tests and see that they are properly closing the connection to the database once it has finished running so that the next test can set up its own. Not having your code properly close your connection after your script runs can lead to you exhausting your DB Servers resources and potentially cause a Denial Of Service issue.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Agelios agelios765 Joined 10 Jul 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.