Deployments performed in switch mode require two databases, where repository assets are updated on the target site’s inactive database while its live database runs undisturbed. Both databases must begin with identical content. You can ensure this in one of two ways:

Definition files of target site repositories must not contain operation tags such as <add-item>, <update-item>, and <remove-item>. These tags cause switch deployments to fail.

Perform the following steps on the target site Oracle Commerce Platform servers:

Configure a SwitchingDataSource

Switch deployment uses a SwitchingDataSource (atg.service.jdbc.SwitchingDataSource) instead of a regular data source such as atg.service.jdbc.MonitoredDataSource. During deployment, it typically switches between two data sources. DataSource method calls are passed through to the data source that is specified by the SwitchingDataSource‘s currentDataSource property.

Caution: If you have multiple independent Oracle Commerce Platform clusters that share a single SDSRepository, each cluster must use a unique set of SwitchingDataSource names. Otherwise, the clusters interfere with each other during the switching process.

Set the following properties of the SwitchingDataSource component:

Name

Description

dataSources

A ServiceMap of DataSources that maps the short names of data sources to their Nucleus component paths. For example:

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

initialDataSourceName

The short name of the data source to use as the currentDataSource on the first deployment. On subsequent runs, the initial currentDataSource is obtained from the state recorded in the SDSRepository.

repository

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

Specifies the switching data source repository SDSRepository, which monitors which database the switching data source points to at any time.

The following example shows the default settings of the switching data source used by the Commerce product catalog:

$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

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