ATG applications running on JBoss use a JTDataSource
component, which must be configured to point to a JNDI reference to a DataSource
component running in JBoss.
The ATG platform installation includes an XML file that contains the configurations for all the data sources for each application, along with a JNDI name for each data source. The startup script copies this XML file into the JBoss config
directory so that these data sources are already running when JBoss starts.
Any Dynamo application that does not use the standard out of the box SOLID DataSource
with admin/admin login must specify which data source it will use. This should be specified in the jbossconfig
configuration layer (see Configuration Override Layers later in this chapter, and Working with Configuration Layers in the Configuring Nucleus Components chapter of the ATG Programming Guide).
In order to use the jbossconfig
directory, modify the MANIFEST.MF
file for the given Dynamo module to include the following property:
ATG-JbossConfig-Path: jbossconfig
Then make a directory called jbossconfig
(if it does not already exist for your application) and put your properties files there.
When you install the ATG platform, a JBoss datasource named atg-solid-ds.xml
is created for SOLID, using the JNDIDataSourceName ATGSolidDS
and other SOLID parameters (URL, driver class, etc.). The SOLID database contains the tables necessary for running ATG and the demo applications. When you deploy your site, you should reconfigure JBoss to use a different data source. The SOLID database is suitable for evaluation and development, but not for a high-volume site.
To configure a new data source, go to the <JBdir>\server\atg\deploy\atg-solid-ds.xml
file (or the equivalent location if your server is named differently). Rename it to something appropriate (the file name must end in –ds.xml
, for example atg-oracle-ds.xml
) and 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:@otto.na.ad.atg.com: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>
If you have changed the JNDI name, also change the one configured in the <ATG2007.3dir>/home/localconfig/atg/dynamo/service/jdbc/JTDataSource.properties
file:
$class=atg.nucleus.JNDIReference
JNDIName=JNDIDataSourceName
For example, java:/ATGOracleDS
.
Then edit <JBdir>/bin/run.sh
and add your database class files, such as Oracle’s ojdbc14.jar
, to the JBoss classpath. To do this, search for x$JBOSS_CLASSPATH
and just above it, create a line:
JBOSS_CLASSPATH=path_to_ojdbc14.jar
Rebuild and redeploy your EAR file.