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 sample shows the default format of the switching datasource used by the product catalog in ATG 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
 
loading table of contents...