Setting up the CHA involves setting up the
CHA server and configuring the application to use the CHA. Setting up the
CHA server create the CHAInstance, CHAChildren and CHAControl tables used
by the server and deploys the server in WebSphere(R) Application Server. CHA
server can work with any one of the three famous Database: DB2(R) v7.2 or v8.1.4
or above, Oracle 8i or 9i, and SQLServer2000.
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 (dse.ini) 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 WebSphere 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.
- 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.
- rootLocation - specify the CHA server location where the root context
will be created. Its value should be: iiop://hostname:2809. The user can
choose 2809 to another RMI port number.
- myLocation - specify the CHA server location where CHA client may
use local EJB reference to call. Its value should be: iiop://hostname:2809.
The user can choose 2809 to another RMI port number.
- CHAInstanceForRootLocalHome - provides the EJB local reference
of the CHAInstanceForRoot CMP. The default value is java:comp/env/ejb/CHAInstanceForRoot.
Except for the prefix of java:comp/env/, the setting value must be the same
as the EJB local reference for the deployed CHAInstanceForRoot (ejb/CHAInstanceForRoot)
bean.
- CHAInstanceForSessionLocalHome - provides the EJB local reference
of the CHAInstanceForSession CMP. The default value is java:comp/env/ejb/CHAInstanceForSession.
Except for the prefix of java:comp/env/, the setting value must be the same
as the EJB local reference for the deployed CHAInstanceForSession (ejb/CHAInstanceForSession)
bean.
- CleanupCHAServer - cleans up the CHAInstance table, CHAChildren
table, and CHAControl table when the value is set to true.
- SupportMultipleCHAServers - supports multiple CHA servers when
the value is set to true.
<kColl id="settings">
...
<kColl id="cha-server">
<field id="ejbInitialContextFactory"
value="com.ibm.websphere.naming.WsnInitialContextFactory"/>
<field id="rootLocation" value="iiop://zhpf:2809"/>
<field id="myLocation" value="iiop://zhpf:2809"/>
<field id="CHASessionHome"
value="ejb/com/ibm/btt/cha/ejb/CHASessionHome"/>
<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="CHAInstanceForRootLocalHome"
value="java:comp/env/ejb/CHAInstanceForRoot"/>
<field id="CHAInstanceForSessionLocalHome"
value="java:comp/env/ejb/CHAInstanceForSession"/>
<field id="CHAControlLocalHome"
value="java:comp/env/ejb/CHAControl"/>
<field id="InitContextTreeLocalHome"
value="java:comp/env/ejb/InitContextTree"/>
<field id="CHAChildrenLocalHome"
value="java:comp/env/ejb/CHAChildren"/>
<field id="initTailContextName" value="branchServer"/>
<field id="cleanupCHAServer" value="true"/>
<field id="isLocalCall" value="false"/>
<field id="supportMultipleCHAServers" value="false"/>
</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 dse.ini 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 isLocalCall to false in the client
side dse.ini file