In many database-dependent applications, you may want to make changes in an offline database and then switch over your live application so that the inactive database becomes the live database. Oracle ATG Web Commerce’s switching facility is based on a class named atg.service.jdbc.SwitchingDataSource. You can use a SwitchingDataSource in place of a regular data source (such as atg.service.jdbc.MonitoredDataSource). The SwitchingDataSource can be switched between two or more underlying DataSources. All DataSource method calls are passed through to the DataSource specified by the currentDataSource property of the SwitchingDataSource. Note that each DataSource that the SwitchingDataSource points to must be of class atg.nucleus.JNDIReference, with a JNDIName property that points to an application server data source. See Configuring Data Sources and Transaction Management for more information.

The switching database is meant to complement the DBCopier components. For example, if you are using Oracle ATG Web Commerce, you would update an inactive database, switch your live site to that database, then copy the currently-active database to the inactive database using the database vendor’s native bulk copy tools.

Note: Unlike DBCopier, Oracle ATG Web Commerce’s switching facility is a JDBC mechanism.

To set up and use a database switching service:

  1. Configure DataSources that connect to your live and inactive databases.

  2. Configure a SwitchingDataSource component, as described in Configuring a SwitchingDataSource.

  3. Configure the Repository components that use the DataSources to point to the SwitchingDataSource. Also set the Repository components’ selectiveCacheInvalication property (see Configure Selective Cache Invalidation in the Content Administration Programming Guide).

Important: If you have multiple independent Oracle ATG Web Commerce clusters that share a single SDSRepository, make sure each cluster uses a unique set of SwitchingDataSource names. Otherwise, the clusters interfere with each other during the switching process.


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