Replace \Drupal\Core\Database\Connection::destroy() with a proper destructor

Created on 17 April 2020, over 4 years ago
Updated 11 September 2023, about 1 year ago

Problem/Motivation

In #843114: DatabaseConnection::__construct() and DatabaseConnection_mysql::__construct() leaks $this (Too many connections) β†’ we added \Drupal\Core\Database\Connection::destroy() but this introduces an unmanaged state of destroyed to a connection object that atm is completely untracked. This caused distractions while fixing #3126563: Replace usage of assertAttributeEquals() that is deprecated β†’ .

Proposed resolution

Use proper object destruction functions to result in reliable behaviour and simplify code.

Remaining tasks

Create change record

User interface changes

None

API changes

\Drupal\Core\Database\Connection::destroy() is deprecated.

Data model changes

None

Release notes snippet

@tdo

πŸ› Bug report
Status

Fixed

Version

9.1

Component
DatabaseΒ  β†’

Last updated 2 days ago

  • Maintained by
  • πŸ‡³πŸ‡±Netherlands @daffie
Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

Live updates comments and jobs are added and updated live.
  • Needs framework manager review

    It is used to alert the framework manager core committer(s) that an issue significantly impacts (or has the potential to impact) multiple subsystems or represents a significant change or addition in architecture or public APIs, and their signoff is needed (see the governance policy draft for more information). If an issue significantly impacts only one subsystem, use Needs subsystem maintainer review instead, and make sure the issue component is set to the correct subsystem.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024