When an activity fails, what happens to the database connection?
Question
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?
Answer
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
Oracle's WebLogic server, Configuring JDBC Data Sources
Previous topic JDBC driver configuration for external databases using JDBC URL Next topic Apache Cassandra database support