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

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:
  1. 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"/>

     
  2. Update the prconfig.xml file with the below tag:

    <env name="database/databases/sqlPEGAWhiplash/dataSource" value="java:comp/env/jdbc/sqlPEGAWhiplash"/>
     
  3. 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>

     
  4. Enure that the below JAR files are present in the Tomcat library:

    a. mssql-jdbc-7.2.1.jre8.jar
    b. sqljdbc42.jar
     
  5. Restart the server including the Util nodes.

Published April 25, 2020 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

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