Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

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.

When an activity fails, what happens to the database connection?

Updated on September 13, 2021


A developer asks: An activity in our application fails and produces a Java stack trace in the PegaRULES log. The failure is not related to the PegaRULES database connection. Is the database connection still available for the next activity call? How do we determine the status of the database connection?


In most cases, the database connection is available to other requestors. For example, if you are using IBM WebSphere Application Server to pool your connections, when an exception occurs and the thread terminates, the database connection is closed and returned to the connection pool for reuse.

If the thread does not terminate and the exception is not related to the database, then the connection may still be available to your thread. This possibility, however, depends on factors such as the DBMS, JDBC Driver, JVM, and application server that you are using.

Best Practices

The best practice for Version 5.x and later releases is to use connection pooling at the application server level, instead of using the connection pooling provided by Process Commander, as explained in the related topic cited below.

To learn more about the lifecycle of database connections managed by connection pooling with supported application servers, refer to the references cited below.

Additional Information

 Apache Tomcat 5.5 Servlet/JSP Container, JNDI Datasource How To Examples, Database Connection Pool (DBCP) Configurations

 Oracle's WebLogic server, Configuring JDBC Data Sources

 WebSphere Application Server, Version 6.1, Developing and deploying applications, Developing WebSphere applications, Data access resources, Task overview: Accessing data from applications, Connection management architecture, Connection pooling


  • Previous topic JDBC driver configuration for external databases using JDBC URL
  • Next topic Apache Cassandra database support

Have a question? Get answers now.

Visit the Support 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. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us