Coherence*Web can be used in an WebLogic Portal environment to provide session state management based on Coherence. Coherence*Web allows for more advanced deployment models, session models, and locking modes in a clustered environment. For more information about these features, see Chapter 5, "Coherence*Web Session Management Features."
This chapter contains the following sections:
Oracle WebLogic Server releases 10.3.1 or later do not require a patch. If you are using release 10.3.1 or later, you can skip this section.
If you are using WebLogic Server 10.3 or earlier, apply the appropriate software patch to all WebLogic Server instances that are hosting the Web applications that will use Coherence*Web. Table 10-1 lists the appropriate patches for your version of WebLogic Server and Coherence release level.
|WebLogic Server 9.2 MP1||WebLogic Server 10.3||WebLogic Server 10.3.1 and later|
WebLogic Smart Update
Patch ID: AJQB
No patch required.
The patches can be downloaded by using either the MyOracleSupport Web site or the WebLogic Server's Smart Update utility.
To Download from MyOracleSupport:
Go to the MyOracleSupport Web site to manually locate the patch.
Select the Patches tab and click the Simple Search link. On the subsequent screen, submit a search for a Patch Number/Name with the appropriate value (for example,
Download the patch zip file from the displayed results.
README.txt included in the patch zip file for instructions for applying the Coherence patch.
To Download Using Smart Update:
Review the instructions in the Smart Update Guide for using Smart Update to install WebLogic Server patches.
For production environments, Oracle recommends that you review the Smart Update production installation.
You can find the Smart Update Guide at this URL:
Select Start then All Programs then Oracle WebLogic then Smart Update to open the login dialog box. Use your support ID and password to log in.
Download and apply the appropriate patch for your release of WebLogic Server. Figure 10-2 illustrates the Oracle Smart Update browser.
Follow these steps to use Coherence*Web with WebLogic Portal:
A cache server JVM is a dedicated Coherence JVM that is responsible for storing and managing all cached data (in this case, the HTTP Session state). One or more cache server JVMs must be started before the WebLogic Server or WebLogic Portal JVMs can be started. Follow these steps to start a cache server:
Create a script for starting a Cache Server JVM. The following is an example of a script that starts a storage-enabled cache server for use with Coherence*Web. See "JVM Tuning" in Developer's Guide for Oracle Coherence for more information about tuning your particular JVM.
java -server -Xms512m -Xmx512m -cp <Coherence installation dir>/lib/coherence.jar:<Coherence installation dir>/lib/coherence-web-spi.war -Dtangosol.coherence.management.remote=true -Dtangosol.coherence.cacheconfig=WEB-INF/classes/session-cache-config.xml -Dtangosol.coherence.session.localstorage=true com.tangosol.net.DefaultCacheServer
Start one or more cache server JVMs using the script described in the previous step.
This configuration file is located in the
coherence-web.jar file. If you modify the
session-cache-config.xml file, then you must replace it in the JAR file.
See Appendix C, "Session Cache Configuration File" for a description of the default configuration of the
See Integration Guide for Oracle Coherence for more information about the P13N
CacheProvider SPI implementation and Web Services for Remote Portlets (WSRP)-federated portals.
If you want to use the Coherence P13N cache as the default cache provider, add the following line before the first
<cache> element to the
META-INF\p13n-cache-config.xml file in the portal enterprise application:
coherence-web-spi.war file by using a library reference (
library-ref) in the
WEB-INF\weblogic.xml file in the portal Web application:
<wls:library-ref> <wls:library-name>coherence-web-spi</wls:library-name> </wls:library-ref>
<context-param> <param-name>coherence-web-sessions-enabled</param-name> <param-value>true</param-value> </context-param>
The Coherence cache provider can be configured to provide caching services for enterprise applications that run on WebLogic Portal. To accomplish this, the cache providers and the WebLogic portal servers are set up to run in an out-of-process deployment topology.
In out-of-process topology, the WebLogic portal servers (or, WebLogic Portal server tier) are configured as cache clients with local storage disabled (that is, the
tangosol.coherence.session.localstorage system properties are set to
false) and there are dedicated JVMs running as cache servers, physically storing and managing the clustered data.
This approach has these benefits:
Session data storage is offloaded from the WebLogic Portal tier to the cache server tier. This reduces heap usage, garbage collection times, and so on.
The WebLogic Portal and cache server tiers can be scaled independently. If more application processing power is needed, start more WebLogic Portal servers. If more session storage capacity is needed, start more cache servers.
Out-of-process topology is the default recommendation of Oracle Coherence due to its flexibility. Figure 10-3 illustrates the out of process topology. Each of the WebLogic Portal servers in the portal tier maintain their own near cache. These near caches communicate with the session data cache which runs in a separate cache server tier.
See "Deploying Coherence Cache Provider for Out-of-Process Topology" for instructions on how to configure this topology.
Obtain the session cache and portal cache configuration files:
session-cache-config.xml file from the
portal-cache-config.xml file from the
Merge the contents of the
portal-cache-config.xml files so that a set of Coherence grid nodes can support both types of objects: session and P13N cache.
You will need two copies of this file: one that will be used by the Coherence cache servers and one that will be used by the WebLogic Portal managed servers. The contents of the two files will be identical, except for the values of the
local-storage properties in the portal cache and the session cache sections.
Example D-1 in Appendix D, "Cache Configuration for WebLogic Portal and Oracle Coherence" illustrates a merged configuration file that can be used for the WebLogic Portal managed servers. The
local-storage values for the session cache and portal cache are set to
false. The configuration file for the Coherence cache server can be the same as Example D-1, except the values for the
local-storage system property in the session cache configuration section and portal cache configuration section must be set to
Use the merged configuration file for the WebLogic Portal managed server as the cache configuration file for the servers. For each application that will run on the WebLogic Portal managed server, copy the file to the application's
Set the merged configuration file for the Coherence caches as the cache configuration for the Coherence grid JVMs. For example, in the following system property to locate the cache configuration file,
portal-session-cache-config.xml represents the merged file:
Add the system properties to disable local storage for the WebLogic Portal managed servers. For example, you can add the following properties to your Coherence cache server startup script:
-Dtangosol.coherence.weblogic.localstorage=false -Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.session.localstorage=false
coherence-web-spi.war files as shared libraries to all of the WebLogic Portal managed servers where the application will be deployed.
See the deployment instructions in "Using Coherence*Web with WebLogic Portal—Main Steps".
Start the Coherence grid with the command line system properties for local storage and session storage set to true:
... -Dtangosol.coherence.weblogic.localstorage=true -Dtangosol.coherence.session.localstorage=true ...
Start the WebLogic Portal managed servers.