2 Integrating Coherence Applications with Coherence*Web

This chapter provides more detailed information on how to package and configure applications that use both Coherence and Coherence*Web. You can find more information on Coherence*Web and how to enable it for applications running on a variety of application servers in User's Guide for Oracle Coherence*Web.

2.1 Merging Coherence Cache and Session Information

In Coherence, the cache configuration deployment descriptor provides detailed information about the various caches that can be used by applications within a cluster. Coherence provides a sample cache configuration deployment descriptor, named coherence-cache-config.xml, in the root of the coherence.jar library.

In Coherence*Web, the session cache configuration deployment descriptor provides detailed information about the caches, services, and attributes used by HTTP session management. Coherence*Web provides a sample session cache configuration deployment descriptor, named session-cache-config.xml, in the WEB-INF/classes directory of the coherence-web-spi.war library.

At run time, Coherence uses the first coherence-cache-config.xml (or session-cache-config.xml) file that is found in the classpath, and it must precede the coherence.jar library; otherwise, the sample coherence-cache-config.xml file in the coherence.jar file is used.

If your Coherence applications are using Coherence*Web for HTTP session management, the start-up script for the application server and the Coherence cache servers must reference the session cache configuration file--not the cache configuration file. In this case, you must perform these steps:

  1. Extract the session cache configuration file from the coherence-web-spi.war library.

  2. Merge the cache information from the Coherence cache configuration file into the session cache configuration file.

    Note that in the cache scheme mappings in this file, you cannot use wildcards to specify cache names. You must provide, at least, a common prefix for application cache names.

  3. Ensure that modified session cache configuration file is used by the Coherence members in the cluster.

    The cache and session configuration must be consistent across WebLogic Servers and Coherence cache servers.