Using CICS bundle PHASEIN to dynamically update an OSGi bundle without updating CICS resources

Use this update method to phase in a new version of an OSGi bundle when service outages and CICS® resource changes cannot be tolerated during the update.

Before you begin

The new version of the JAR file for the OSGi bundle must be present in the same zFS directory as the old version of the OSGi bundle, that is, the same directory as the associated osgibundle bundlepart file. By default, this directory is the directory that is named in the BUNDLE resource definition. This new version of the OSGi bundle must have a higher version than the one that is currently installed in the OSGi framework, and the version must be in the version range that was defined when the OSGi bundle reference was added to the CICS bundle project.

Procedure

To phase in a new version of an OSGi bundle in an OSGi JVM server, use the following steps.

  1. In the Bundles view in CICS Explorer®, right-click the CICS bundle that contains the OSGi bundle, click Phase In, then click OK. The new version of the OSGi bundle is phased in, new versions of any services that are implemented by the new version of the OSGi bundle are installed into the OSGi framework, and any old versions of the services are removed from the OSGi framework.
  2. In the OSGi Services view in CICS Explorer check that all OSGi services for the new version of the OSGi bundle are all in the active state.
  3. In the OSGi Bundles view in CICS Explorer check that the new version of the OSGi bundle is listed and is in the active state.

Results

The new version of the OSGi bundle is used for all new service requests. Existing requests continue to use the old version. The symbolic version of the OSGi bundle increases, indicating that the Java™ code is updated.

What to do next

If you are satisfied that the new version of the OSGi service is working well, there is no more to do. Optionally, you can delete the old version of the OSGi JAR file from zFS, but it is not compulsory. It might also be useful to retain the OSGi JAR file so that you can restore that version if problems arise with the new version.

If you are not satisfied with the new version of the OSGi service and want to restore the old version, use the following steps.

  1. Delete the new version of the OSGi bundle JAR from zFS.
  2. In the Bundles view of CICS Explorer, right-click the CICS bundle that contains the OSGi bundle, click Phase In, then click OK. Because the old version of the OSGi bundle is now the one with the highest version on zFS, it is reinstalled into the OSGi framework and the defective new version removed.
  3. In the OSGi Services view in CICS Explorer, check that only the OSGi services for the old version of the OSGi bundle are listed, and are all in the active state.
  4. In the OSGi Bundles view in CICS Explorer, check that only the old version of the OSGi bundle is listed and is in the active state.

If there is a CICS cold, warm, or emergency restart, the new version of the OSGi bundle is automatically restored. You do not need to change any CICS resource definitions to ensure that this happens.