Tomcat does not revalidate connections
Tomcat does not revalidate connections before providing a connection to Pega 7 platform.
[MSG][Unable to retrive autocommit value due to following error This connection has been closed.][STACK][org.postgresql.util.PSQLException: This connection has been closed.
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
Steps to Reproduce
Run a Stress test or leave an active system idle for a period of time.
A defect or configuration issue in the operating environment.
The Connection pool elements in the context.xml are insufficient to guarantee that the connection provided to Pega is valid. An explicit set of connection pool parameters must be provided instead.
Make the following change to the operating environment:
Add the below attributes in the Resource element for the jdbc/PegaRULES connection,
This causes the validation query to be executed at specific points in time, as follows:
testOnBorrow - If true, connections are validated before they are returned from the pool. If the validation fails, the connection is destroyed and a new connection is retrieved from the pool (and validated).
testOnConnect - The indication of whether objects will be validated when a connection is created. If an object fails to validate, SQLException occurs.
testOnReturn - If true, connections are validated before they are returned to the pool. If the validation fails, the connection is destroyed instead of being returned to the pool.
testWhileIdle - If true, connections will be validated by the idle connection evictor (if any). If the validation fails, the connection is destroyed and removed from the pool.
The validation query above is valid for Postgres.
For long running queries that are disconnected, change the following: removeAbandoned="true"
removeAbandonedTimeout="some large number greater than the longest expected query"
Additionally, set the following,
The below setting logs abandoned connections,
100% found this useful