Using JNDI Data Sources in Web Central

System Administrators can configure Web Central to use JNDI DataSource. Components that do not ship with Archibus or support a configuration that uses non-Archibus components cannot be certified. For that reason, the instructions below outline a UAT test for verifying your configuration before you deploy to production.

Depending on your configuration, you may need to purchase a separate JNDI license to use this feature.

Configuring Web Central to use JNDI DataSource

To use JNDI data sources:

  1. Configure JNDI DataSource within your application server.

  2. Configure Web Central to use the JNDI DataSource

To illustrate, the text below provides an example that configures Web Central to use Oracle JNDI DataSource in Tomcat application server.

Example of configuring Tomcat

Apache provides instructions for configuring JNDI DataSource in Tomcat here: https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html .

Make changes like the following to your \tomcat\conf\context.xml :

… <Context> … <Resource auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" name="jdbc/dataSourceOracle" username="afm" password="afm" url="jdbc:oracle:thin:@myserver:1521:hq" /> </Context>

Example of configuring Web Central

Make changes like the following to your /WEB-INF/web.xml :

<web-app …> … <resource-ref> <res-ref-name>jdbc/dataSourceOracle</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </web-app>

Make changes like the following to your \WEB-INF\config\afm-projects.xml

:… <afm-projects> <project> <preferences name="HQ-Oracle" title="Headquarters-Oracle" active="true" … /> <databases> <database role="data" maxNumberOfRecords="100"> <login defaultAccount="" defaultPassword="" /> <engine type="Oracle"> <jdbc jndiDataSourceName="java:comp/env/jdbc/dataSourceOracle" /> </engine> </database> <database role="schema" maxNumberOfRecords="0"> <login defaultAccount="" defaultPassword="" /> <engine type="Oracle"> <jdbc jndiDataSourceName="java:comp/env/jdbc/dataSourceOracle" /> </engine> </database> <database role="security" maxNumberOfRecords="0"> <login defaultAccount="" defaultPassword="" /> <engine type="Oracle"> <jdbc jndiDataSourceName="java:comp/env/jdbc/dataSourceOracle" /> </engine> </database> </databases> </project> </afm-projects>

Example of configuring Microsoft SQL Server

In the case of MS SQL, \tomcat\conf\context.xml should look like the following. In this case, \WEB-INF\web.xml and \WEB-INF\config\afm-projects.xml will point to dataSourceSQLServer .

<Context> … <Resource auth="Container" description="Pooled SQLServer DataSource" maxActive="100" maxIdle="30" maxWait="10000" type="javax.sql.DataSource" driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" name="jdbc/dataSourceSQLServer" username="afm" password="afm" url="jdbc:sqlserver://127.0.0.1:1433;databaseName=HQ" /> </Context>

UAT Testing

Tests on the default configurations of database connection pool (Apache Commons DBCP) and JDBC drivers have been run to ensure adequate performance of the components in production. In doing so, we carefully chose versions of the database connection pool and JBDC drivers that passed the stress test, as testing showed that some versions of the database connection pool libraries and JDBC drivers had memory leaks or multi-threading problems (such as deadlocks or thread contention).

To meet the needs of their own site's policies, System Administrators may wish to use different components and drivers when configuring JNDI DataSource. As we do not produce these libraries and they do not ship with the Archibus program, we cannot certify them. For that reason, as part of the deployment process System Administrators should perform a UAT test to verify that the configuration works as intended.

System Administrators can contact Archibus Professional Services for a Statement of Work if they wish Professional Services to perform a UAT test.

When designing the UAT test:

  • Use a test automation tool, such as Apache JMeter ( http://jmeter.apache.org/index.html ), to script several typical end-user scenarios by recording them from the Web Central interface. Make certain these scenarios create, read, update, and delete information.

  • Run these scenarios in a combination that provides a typical load for the typical number of users of each type to test the performance. Vary the timing of running each scenario to uncover deadlock or thread contention issues.

  • When running the test, use a profiling tool, such as EJ Technologies' JProfiler, to watch for memory leaks and JDBC warnings.