Developers/Maximum number of connections exceeded

From Aimeos documentation

Developers
Other languages:
English 100% • ‎русский 80%


Maximum number of connections exceeded

Database connections are shared across all managers and the database manager is configured to provide only a single database connection. If you acquire a connection in your manager and forget to release it, you will get the error as soon as the next manager tries to acquire the connection. Usually, your code should try to avoid problems like this:

  1. $dbm = $this->context->getDatabaseManager();
  2. $conn = $dbm->acquire();
  3.  
  4. try
  5. {
  6. 	// do something
  7. 	$dbm->release( $conn );
  8. }
  9. catch( Exception $e )
  10. {
  11. 	$dbm->release( $conn );
  12. 	throw $e;
  13. }