Set the following properties of the SwitchingDataSource component:

Name

Description

initialDataSourceName

The short name for the DataSource that should be used for the currentDataSource on the very first run. On subsequent runs, the initial currentDataSource is obtained from the state recorded in the SDSRepository.

dataSources

Set to a ServiceMap of DataSources. This property maps short names of DataSources to their Nucleus component path. The following example shows how you might set the dataSources property:

dataSources=FirstDataSource=\
/atg/dynamo/service/jdbc/FirstDataSource,\
  SecondDataSource=\
/atg/dynamo/service/jdbc/SecondDataSource

repository

Set with a reference to /atg/dynamo/service/jdbc/SDSRepository.

This refers to the switching data source repository, which keeps track of which database the switching data source points to at any time.

This sample shows the default format of the switching datasource used by the product catalog in Oracle ATG Web Commerce:

$class=atg.service.jdbc.SwitchingDataSource
#
# A map from data source names to data sources
#
dataSources=\
     DataSourceA=/atg/commerce/jdbc/ProductCatalogDataSourceA,\
     DataSourceB=/atg/commerce/jdbc/ProductCatalogDataSourceB

#
# The name of the data source that should be used on startup
#
initialDataSourceName=DataSourceA

repository=/atg/dynamo/service/jdbc/SDSRepository

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