Setting up the remote CHA involves setting up the CHA server and
configuring the application to use the CHA. Setting up the CHA server is to
create the CHAInstance, and CHAControl tables used by the server and deploy
the server in WebSphere® Application
Server. CHA server can work with any one of the three famous Database: DB2® v7.2
or v8.1.4 or above, Oracle 8i, 9i, or 10g, and SQLServer2000 and SQLServer2005.
To
set up the CHA server, do the following:
An application must contain the CHA facade and other related classes
contained in the BTTBase.jar and be configured so that the CHA facade can
find the CHA server before it can use the CHA.
To set up an application
to use the CHA, edit the system configuration files (btt.xml) for the client
and server side of the CHA to configure the following settings:
- ejbInitialContextFactory - provides the value for the InitialContextFactory
parameter when creating the javax.naming.InitialContext for JNDI lookup. The
default value is com.ibm.websphere.naming.WsnInitialContextFactory, which
is the value for Rational Application Server.
- CHASessionHome - provides the JNDI name of CHASession Session
Bean. The default value is ejb/com/ibm/btt/cha/ejb/CHASessionHome. This value
must be the same as the JNDI name used to deploy the CHASession.
- EJBProviderURL - specify the CHA server location: iiop://hostname:2809.
The user can change 2809 to other RMI port numbers.
- CHASessionLocalHome - provides the local reference for the CHASession
entity bean. The default value is java:comp/env/ejb/CHASession. Except for
the prefix of java:comp/env/, the setting value must be the same as the EJB
local reference for the deployed CHASession (ejb/CHASession) bean.
- CHAInstanceHome - provides the JNDI name of the CHAInstance CMP.
The default value is ejb/com/ibm/btt/cha/ejb/CHAInstanceHome. This value must
be the same as the JNDI name used to deploy the CHAInstance.
- CHAInstanceLocalHome - provides the EJB local reference of the
CHAInstance CMP. The default value is java:comp/env/ejb/CHAInstance. Except
for the prefix of java:comp/env/, the setting value must be the same as the
EJB local reference for the deployed CHAInstance (ejb/CHAInstance) bean.
- CHAControlLocalHome - provides the EJB local reference of the
CHAControl CMP. The default value is java:comp/env/ejb/CHAControl. Except
for the prefix of java:comp/env/, the setting value must be the same as the
EJB local reference for the deployed CHAControl bean.
- initTailContextName - identifies the root context when initializing
a context tree. The default value is "", which means the initialization is
not performed. If the setting contains a valid value, the startup bean initializes
the context and its children. If the setting value is not valid, an error
occurs and the CHA server does not start. The server side only must have this
setting.
- isLocalCall - indicates whether the CHA façade (EJB client) accesses
the CHA Server (EJB container) using the EJB local reference. The default
value is false. If set to true, the values of the CHASessionLocalHome and
CHAInstanceLocalHome settings set for the CHA facade must be the same as the
EJB local references for the CHASession and CHAInstance.
- CleanupCHAServer - cleans up the CHAInstance table, CHAChildren
table, and CHAControl table when the value is set to true.
- startMode - identifies the start mode of CHA. "PersistenceShared"
means using remote EJB and database persistence. "MemoryShared" means using
only remote EJB without database persistence.
<kColl id="settings">
...
<kColl id="cha-server">
<field id="ejbInitialContextFactory" value="com.ibm.websphere.naming.WsnInitialContextFactory"/>
<field id="CHASessionHome" value="ejb/com/ibm/btt/cha/ejb/CHASessionHome"/>
<field id="EJBProviderURL" value="iiop://localhost:2809"/>
<field id="CHASessionLocalHome" value="java:comp/env/ejb/CHASession"/>
<field id="CHAInstanceHome" value="ejb/com/ibm/btt/cha/ejb/CHAInstanceHome"/>
<field id="CHAInstanceLocalHome" value="java:comp/env/ejb/CHAInstance"/>
<field id="CHAControlLocalHome" value="java:comp/env/ejb/CHAControl"/>
<field id="initTailContextName" value="branchServer"/>
<field id="cleanupCHAServer" value="true"/>
<field id="isLocalCall" value="false"/>
<field id="startMode" value="PersistenceShared"/>
</kColl>
...
</kColl>
If a servlet or EJB calls the CHA facade and
they are in the same EAR file as the CHA server, the facade can use the local
EJB interface. To set up the CHA facade to use the local interface to access
the CHA EJBs:
- In the btt.xml file, set the value of isLocalCall to true.
- In the servlet or EJB that calls the CHA, establish the EJB local reference
for the CHAInstance and CHASession EJBs.
If the servlet or EJB are not in the same EAR file as the CHA server,
the facade must use the remote EJB interface. To set up the CHA facade to
use the remote interface, set the value of is LocalCall to false in the client
side btt.xml file.