How to resolve "Unable to obtain a connection from the connection pool for data source" error for the Cache DB in the TIBCO Data Virtualization server?

How to resolve "Unable to obtain a connection from the connection pool for data source" error for the Cache DB in the TIBCO Data Virtualization server?

book

Article ID: KB0073479

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All supported versions

Description

A connection pool is a cache of database connections for reuse when future requests to the database need them. When the system runs out of available connections, and could not obtain a new connection from the connection pool, the below error is reported in TIBCO Data Virtualization (TDV) server.

***cs_server.log***

A system exception has occurred. 
 at AnonymousProcedure (line 20)
 caused by: Timeout 30 seconds while attempting to get connection from pool '/lib/sources/defaultCacheDataSource'. Unable to create a new connection and timed out waiting for one of the 97 connections currently in use in the pool. [script-1900011]
Unable to obtain a connection from the connection pool for data source
 "/lib/sources/defaultCacheDataSource
". SQL State = 53300 SQL Error Code = 0 [data-2911001]
Cause: FATAL: remaining connection slots are reserved for non-replication superuser connections [Log ID: c343776f-4e59-4bf8-a42e-84ff27907d01] [?2021-?03-?11 09:39]


***cs_server.log***
 

Environment

All supported environments.

Resolution

In general, the connection pool maximum size can be altered in the datasource configuration parameter for that connection, including external Cache DB. However, when default Cache DB is used, TDV creates the cache in the PostgreSQL DB. The maximum size parameter value for the connection pool is configured in <TDV Server Install Directory>\repository\data_cache\postgresql.conf property file.

------------------------------------------------------------------------------# CONNECTIONS AND AUTHENTICATION#------------------------------------------------------------------------------
# - Connection Settings -
#listen_addresses = 'localhost' # what IP address(es) to listen on; 
         # comma-separated list of addresses; 
         # defaults to 'localhost'; use '*' for all 
         # (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)


Change the max_connections value to 150 or 200, per the requirement, and restart the TDV Server. 
 

Issue/Introduction

How to resolve "Unable to obtain a connection from the connection pool for data source" error for the Cache DB in the TIBCO Data Virtualization server?