Detect thread obtaining more than one database connection

Description

Openfire interacts with a database. The amount of connections made from Openfire is limited. This makes them a limited resource.

Through inefficient code, it is easy to create a scenario in which a particular process opens more than one database connection. This is inefficient, and is ideally prevented. Worse: if two threads are doing that, and have each acquired one resource before the database connection pool reaches its maximum capacity, they might end up being blocked while waiting for the second resource.

To facilitate detection of problematic code, Openfire should have a feature that keeps track of how many database connections are opened concurrently by a thread. This feature should log a warning if that number is higher than one.

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created February 20, 2023 at 10:18 AM
Updated March 21, 2023 at 9:47 AM
Resolved March 21, 2023 at 9:47 AM