Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Rule-Admin-Product Export Exception



When attempting to export an application either through a product rule, or through the product export wizard Pega produces an exception with no other message.

Error Messages

Caused by: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(
at org.postgresql.jdbc2.AbstractJdbc2Connection.getAutoCommit(
at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(
at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(
at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(
at com.sun.proxy.$Proxy4.getAutoCommit(Unknown Source)
... 17 more

Steps to Reproduce

  1. Create a new Product Rule with application rules listed
  2. Export package from Product Rule

Root Cause

A defect or configuration issue in the operating environment. A third-party product issue: the exception is occurring because connection is getting close from the Postgres side, due to timeouts. After adjusting connection pool settings found the export runs without error but the RAP file is empty. From alert log see that as part of export activity pxLoadInventories is being called. This activity is querying a work history table with over a million records. This query is timing out.


Perform the following local-change:

Add the following connection pool settings to the jdbc/PegaRULES datasource

validationQuery="select 1"

This will cause the validation query to be executed at the specific points in time as follows:

testOnBorrow - If true connections will be validated before being returned from the pool. If the validation fails, the connection is destroyed, and a new connection will be retrieved from the pool (and validated).
testOnConnect - The indication of whether objects will be validated when a connection is first created. If an object fails to validate, it will be throw SQLException.
testOnReturn - If true connections will be validated before being 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. Consult the specific database vendor for appropriate validation query to use.

To work around the long running query that is causing the export of the RAP to fail you can truncate the work history table, as this is a dev environment and you are not concerned about these history records.

Suggest Edit

Published March 26, 2017 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us