Coherence Based Session Management
Assumptions: you have downloaded latest web logic server 10.3.3 and Coherence Web 3.6
from Oracle
Instructions
First we will create weblogic domains : something like DOMAIN_A and DOMAIN_B.
To configure those domains with coherence based session management, then the
changing of session variable value in one domain will propagate to another domain.
Main Steps
Application Server (WebLogic)
1) Create DOMAIN_A and DOMAIN_B
2) Copy coherence.jar to DOMAIN_A\lib and DOMAIN_B\lib
3) Start both the Domains
4) Deploy coherence-web-spi.war as a shared library
Coherence
1) duplicate cache-server.cmd at the same folder in the coherence and rename
it to web-cache-server.cmd
2) modify web-cache-server.cmd as shown below
3) set java_opts="-Xms%memory% -Xmx%memory%"
"%java_exec%" -server -showversion "%java_opts%" -cp
c:\coherence\lib\coherence.jar;c:\coherence\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 %1
4) startup web-cache-server.cmd
5) Modify weblogic.xml to add a reference to coherence-web-spi as shown below
in you application
wls:library-ref
wls:library-name coherence-web-spi wls:library-name
wls:specification-version 1.0.0.0 wls:specification-version
wls:exact true wls:exact
wls:library-ref
deploy the webapp to DOMAIN_A and DOMAIN_B
Now test Session variable value at DOMAIN_A and check wether it is changed at DOMAIN_B, As show in the below figure
|
Coherence In Action |