If the session is idle, the last statement that was executed is displayed in the query column. This is not a "current" request, so the connection does not wait for the commit to complete.
The query column shows only the current statement, if status shows active .
An βidleβ connection is not a problem and is essentially the reason the connection pool is used so that it can be reused. However, sessions that remain very long in standby mode in a transaction are a problem . But you stated that your connections are in a state of "inaction".
If your connection pool reaches the limit, this most likely means that your application incorrectly returns connections to the pool. This is what you need to fix in your application.
source share