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:
Use tools provided by your database vendor to make the two databases identical.
After you configure the target for switch deployments, perform a full deployment to the target.
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 ATG servers:
Configure data sources that connect to the two databases. Each data source must be of class
atg.nucleus.JNDIReference
, where itsJNDIName
property points to an application server data source. For detailed information about configuring data sources, see the ATG Installation and Configuration Guide.Configure a SwitchingDataSource to switch between the two underlying data sources.
Configure destination and production-site repository components so their
datasource
property points to the appropriate SwitchingDataSource.Optionally, configure Selective Cache Invalidation on target repositories.
Add the SwitchingDataSource to the DeploymentAgent’s list of switchable data stores. To do this, set the property
switchableDataStores
to the SwitchingDataSource’s fully qualified Nucleus path, in:<ATG10dir>/home/localconfig/atg/epub/DeploymentAgent.properties
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 ATG 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 |
---|---|
| A
|
| The short name of the data source to use as the |
| Set with a reference to Specifies the switching data source repository |
The following example shows the default settings of the switching datasource 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