Support Article
Connection closed while running specific Extract rule
SA-106396
Summary
While execute Business Intelligence Exchange (BIX) Extract rules (to an external database) throught agents, one of the Extract rule fails with an error. However, the same Extract rule executes correclty when executed from Pega Designer Studio.
Error Messages
"Registrations: table does not exist in sqlWhiplash". The connection is closed.
Steps to Reproduce
Run the Extract rule through an agent.
Root Cause
The BIX Extract was run to an external database every 24 hours. This made the connection stale, which resulted in the Connectionclosed exception.
Additionaly, the earlier Legacy Connection Manager was used for this external database connection. The new Connection Manager has different capabilities which prevented the exception from occurring even when Pega connected with the database after a long interval.
Resolution
Perform the following local-change:
To create a datasource for the external database, and to access the external database through the datasource, perform the below steps:
- Update the context.xml file with the below tag
<Resource name="jdbc/sqlPEGAWhiplash" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://localhost:1433;database=sqlPEGAPHL;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.name;loginTimeout=30"
username="username"
password="password"
minActive="1"
maxActive="100"
minIdle="1"
maxIdle="30"
maxWait="30000"
initialSize="1"
validationQuery="SELECT 1"
testOnBorrow="true"
validationInteval="30000"/>
- Update the prconfig.xml file with the below tag:
<env name="database/databases/sqlPEGAWhiplash/dataSource" value="java:comp/env/jdbc/sqlPEGAWhiplash"/>
- Update the web.xml file with the below tag:
<resource-ref id="ResourceRef_11">
<description>sqlPEGAWhiplash Datasource</description>
<res-ref-name>jdbc/sqlPEGAwhiplash</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
- Enure that the below JAR files are present in the Tomcat library:
a. mssql-jdbc-7.2.1.jre8.jar
b. sqljdbc42.jar
- Restart the server including the Util nodes.
Published April 25, 2020 - Updated December 2, 2021
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.