Migrating Context

This topic introduces how you can migrate BTT version 5.2 Context to BTT version 6.1.2 Context.

You do not need to change the context, type, and data definitions of BTT version 5.2 when you migrate them to BTT version 6.1.2, because these definitions are the same in BTT version 5.2 and BTT version 6.1.2. In BTT version 6.1.2, a class table tag for context implementation class and an initializer tag are added in the CHA configuration in the BTT XML definition file, such as the file btt.xml.

The APIs in BTT version 5.2 and BTT version 6.1.2 are almost the same except the way of constructing the context instance. In BTT version 6.1.2, the context is constructed from ContextFactory. BTT version 5.2 CHA definition tag startMode (value ="PersistenceShared" or "MemoryShared") is replaced by the tag isPersistenceEnabled (value="yes" or "no"). An example of migrating BTT version 5.2 context to BTT version 6.1.2 context is as follows:

  1. Creating BTT version 5.2 context.
    Context ctxt = (Context) Context.readObject("myContext",true);
    Context ctxt2 = new com.ibm.dse.base.Context();
    ctxt2.setName("myContext2");
  2. Creating BTT version 6.1.2 context.
    Context diiTestCtx = ContextFactory.createContext("myContext", true);
    Context ctxt2 = new com.ibm.btt.base.Context();
    ctxt2.setName("myContext2");
The following is an example of BTT version 6.1.2 CHA configuration. Please note the bold text that is different from BTT version 5.2 CHA configuration.
<kColl id="cha">
    <!-- indicates the implementation class of context-->
    <kColl id="classTable">
      <field id="context" value="com.ibm.btt.cha.ejb.RemoteContextImpl" />
    </kColl>

    <!-- indicates the initialization class of CHA-->
    <field id="initializer" value="com.ibm.btt.base.ContextInitializer" />
    <!-- indicates the external file of CHA-->
    <field id="extFile" value="dsectxt.xml" />

    <!-- indicates the JNDI looking up properties of CHA-->
    <field id="ejbInitialContextFactory"
      value="com.ibm.websphere.naming.WsnInitialContextFactory" />
    <field id="EJBProviderURL" value="iiop://localhost:2809" />

    <!-- indicates the home interface of CHAEJB-->
    <field id="CHASessionLocalHome"
      value="java:comp/env/ejb/CHASession" />
    <field id="CHAInstanceLocalHome"
				value="java:comp/env/ejb/CHAInstance" />
    <field id="CHAControlLocalHome"
				value="java:comp/env/ejb/CHAControl" />
    <field id="CHASessionHome"
				value="ejb/com/ibm/btt/cha/ejb/CHASessionHome" />
    <field id="CHAInstanceHome"
				value="ejb/com/ibm/btt/cha/ejb/CHAInstanceHome" />

    <!-- indicates the initialized context tree of CHA-->
    <field id="initTailContextName" value="branchServer" />

    <!-- indicates whether to cleanup the context instance from the DB tables-->
    <field id="cleanupCHAServer" value="true" />

    <!-- indicates whether to use local interface when invoke CHAEJB-->
    <field id="isLocalCall" value="true" />

    <!-- indicates whether the remote CHA supports persistence-->
    <field id="isPersistenceEnabled" value="false" />
    <!--field id="startMode" value="MemoryShared"/-->
</kColl>