The user is using Pega 7.2.2. to connect to an external database for which the data source has created a new database instance and pointed to the data source using JNDI. However, after every JVM restart, this database instance goes out of scope and Pega is unable to connect to the external database until they manually open the database instance rule configured in Pega to connect to external database and re-save it again. The user observes this to occur in both Pega 7.2.1 and Pega 7.2.2
2017-03-22 07:34:48,035|[ server.startup : 0]|[ ]|[ ]|[ ]|(com.pega.pegarules.data.internal.access.DataSourceManager)|ERROR ||| - Unable to obtain DataSource for extdb; javax.naming.NameNotFoundException: Name "comp/env/jdbc/EXTDB" not found in context "java:". 2017-03-22 07:34:48,037|[ server.startup : 0]|[ ]|[ ]|[ ]|(com.pega.pegarules.data.internal.access.ConnectionManagerImpl)|ERROR ||| - Failed to read Data-Admin-DB-Name Definitions: Database-BadDBDef-Missing Unable to obtain DataSource object
Steps to Reproduce
Configure a data source on Websphere to connect to an external database.
Create a DATA-ADMIN-DB-NAME instance in Pega 7.2.2.
Select "use JDBC Connection Pool" option and provide the JNDI name for the configured data source in Websphere.
Restart the JVM and verify if Pega is able to connect to the configured external database.
A defect or configuration issue in the operating environment is identified as root cause of the issue. The user has edited prconfig.xml file to add the data source related information. No change is required in prconfig.xml. Pega should be able to connect to external data source once the configuration for data source and namespace bindings related to data source are created in Websphere. The connection to external database is handled by Websphere. Pega just uses the configured JNDI information to connect to external database.
Make the following change to the operating environment:
Go to Websphere Console > Resources > JDBC > Data sources and configure a Data Source instance in Websphere for connecting to the external database. Screenshot of an example showing Data Source configuration in Websphere is shown below:
Go to Websphere Console > Naming > Name space bindings and configure "Name space bindings" instance in Websphere required for connecting to the external database. Screenshot of an example showing Name Space Bindings configuration in Websphere is shown below:
No changes are needed in prconfig.xml file.
Create a DATA-ADMIN-DB-NAME instance in Pega and Select "use JDBC Connection Pool" option and provide the JNDI name for the configured Data Source in Websphere.