3 Integrating Coherence Applications with Coherence*Web

This chapter provides more detailed information on how to configure applications running under Coherence*Web so that they can share Coherence cache and session information.

You can find more information on Coherence*Web and how to enable it for applications running on a variety of application servers in Oracle Fusion Middleware Administering HTTP Session Management with Oracle Coherence*Web.

3.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 default-session-cache-config.xml, in the coherence-web.jar library. You can use this file as the basis for any custom session cache configuration file you may need to write.

At run time, Coherence uses the first coherence-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.

In the case of Coherence*Web, it first looks for a custom session cache configuration XML file in the classloader that was used to start Coherence*Web. If no custom session cache configuration XML resource is found, then it will use the default-session-cache-config.xml file packaged in coherence-web.jar.

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 complete these steps:

  1. Extract the session cache configuration file from the coherence-web.jar 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.