Oracle ATG Web Commerce applications running on JBoss use a JTDataSource component, which should be configured to point to a JNDI reference to a DataSource component running in JBoss.

Note: The Configuration and Installation Manager (CIM) utility makes these configurations for you. See Configuration and Installation Manager (CIM).

Where to Configure JBoss Data Sources

You should configure your data source in the localconfig, jbossconfig, or equivalent named configuration layer. See “Managing Properties Files” in the Platform Programming Guide for information on application-server-specific and named configuration layers.

In order to use the jbossconfig directory:

  • Modify the MANIFEST.MF file for the given Oracle ATG Web Commerce module to include the following property:

ATG-JbossConfig-Path: jbossconfig
  • Create a jbossconfig directory and put the properties files there.

Note: If JBoss configuration files are stored in the ATG-3rdPartyConfig-Path layer, you might see errors if you start up applications on other application servers, because the data sources are configured to point to JNDI names that are not set up on that application server. Data source configuration files that are specific to JBoss should be in the ATG-JBossConfig-Path rather than the ATG-3rdPartyConfig-Path of those data source configurations.

Configuring New JBoss Data Sources

Note: The following information does not apply to JBoss EAP 6. Refer to the Configuring MSSQL Data Sources on JBoss EAP 6 for instructions.

To configure a new data source, go to the <JBdir>\server\server_name\deploy\atg-ds.xml file. Edit the following configuration settings:

JNDI name
URL
driver class
username
password
transaction isolation level
connection pool numbers

See your application server documentation for information on the available parameters. For example:

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <xa-datasource>
    <jndi-name>atgcore_ds</jndi-name>
    <track-connection-by-tx>false</track-connection-by-tx>
    <isSameRM-override-value>false</isSameRM-override-value>
    <min-pool-size>5</min-pool-size>
    <max-pool-size>100</max-pool-size>
    <blocking-timeout-millis>5000</blocking-timeout-millis>
    <idle-timeout-minutes>15</idle-timeout-minutes>
    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-
isolation>
    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-
datasource-class>
    <xa-datasource-property
 name="URL">jdbc:oracle:thin:@myserver:1521:ora10r2</xa-datasource-
property>
    <xa-datasource-property name="User">username</xa-datasource-property>
    <xa-datasource-property name="Password">password</xa-datasource-property>
    <!-- Uncomment the following if you are using Oracle 9i
    <xa-datasource-property name="oracle.jdbc.V8Compatible">true</xa-
datasource-property>
   -->
    <exception-sorter-class-name>
        org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
    </exception-sorter-class-name>
  </xa-datasource>
</datasources>

Note: Entering passwords in clear text files entails some security risks. Take steps to secure files that contain clear text passwords.

If you have changed the JNDI name, you must also change the name configured in the <ATG11dir>/home/localconfig/atg/dynamo/service/jdbc/JTDataSource.properties file:

$class=atg.nucleus.JNDIReference
JNDIName=JNDIDataSourceName

For example, java:/ATGOracleDS.

Note that if you are using a WatcherDataSource, this would be configured instead in a DirectJTDataSource.properties file.

Adding Database Class Files

If your database driver is located anywhere other than the server’s lib directory (for example, C:\jboss\jboss-eap-install-dir\jboss-as\server\atg_server\lib), you must edit <JBdir>/bin/run.sh|bat and add your database class files, such as Oracle’s ojdbc6.jar, to the JBoss CLASSPATH. To do this, search for $JBOSS_CLASSPATH and just above it, create a line:

JBOSS_CLASSPATH=path_to_ojdbc6.jar

Rebuild and redeploy your EAR file.

Configuring MSSQL Data Sources on JBoss EAP 6

When working with JBoss data sources previous to JBoss EAP 6, you registered data sources using the atg-ds.xml file, as outlined in the Configuring New JBoss Data Sources section. For JBoss EAP 6, data sources are registered in the server instance configuration file, as outlined in the JBoss EAP 6 section.

The following is an example of a JBoss data source configuration:

<subsystem xmlns="urn:jboss:domain:datasources:1.1">
<datasources>
  <drivers>
    <driver module="com.mysql">
      <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
          </xa-datasource-class>
    </driver>
  </drivers>
  <xa-datasource enabled="true" jndi-name="java:/ATGProductionDS"
      pool-name="mysql" use-java-context="true">
    <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/
        production</xa-datasource-property>
      <driver>mysql</driver>
      <security>
        <user-name>user</user-name>
        <password>password</password>
      </security>
      <!-- To avoid deadlocks you need set this -->
      <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
  </xa-datasource>
  <xa-datasource enabled="true" jndi-name="java:/ATGPublishingDS"
      pool-name="mysql" use-java-context="true">
    <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/
        publishing</xa-datasource-property>
      <driver>mysql</driver>
      <security>
        <user-name>root</user-name>
        <password>admin</password>
      </security>
      <!-- To avoid deadlocks you need set this -->
      <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
    </xa-datasource>
  </datasources>
</subsystem>
Configuring DB2 Data Sources on JBoss EAP 6

When you configure DB2 data sources using JBoss EAP 6, you must use the JBC4 complaint data source driver. Ensure that you have set up your configuration using the db2jcc4.jar driver. Refer to your application documentation for additional information.


Copyright © 1997, 2014 Oracle and/or its affiliates. All rights reserved. Legal Notices