+

Search Tips   |   Advanced Search

EJBDEPLOY relationships - troubleshooting tips


(ZOS) DB2 for z/OS v7.x

Problems might exist when EJBDeploy creates a data relationship in DB2 for z/OS v7.x. EJBDeploy creates a table with a composite of the two primary keys of the EJBs related to each other. If the composite keys are larger than 254 characters, DB2 for z/OS V7.x does not accept this relationship and the following error can occur:

This problem can be seen when the primary keys created for the two related beans have primary keys that are strings. This results in the composite being made up of 2 varchar(250) primary keys for a total of 500, which is greater than 254 maximum in DB2 for z/OS version 7.x.

Things to consider when utilizing top-down mappings to ensure we do not experience this problem:

EJBDEPLOY_JVM_ARGS:

Set the EJBDEPLOY_JVM_ARGS property to override Java virtual machine (JVM) options passed to the code that deploys EJBs (ejbdeploy.sh). Set this property in one of the following locations: deploymentmanager/bin/setupCmdLine.sh or appServerHome/bin/setupCmdLine.sh

For example, the following specifies that unqualifed SQL should be generated:


The converter that is defined for the primary key is not invoked on its foreign key value

The mapping for primary key fields to database columns may use a converter to transform the key values. If a container-managed persistence (CMP) bean uses a converter to map its primary key, and that bean has a relationship where the bean at the other end holds a foreign key, the mapping for the foreign key will not use the converter.

The following errors might occur, indicating that the converter defined for the primary key is not invoked on its foreign key value. During the run of the ejbDeploy command, we receive the following message:

During run time, the application does not find the CMP bean at the other end of the relationship.

To work around this limitation, define our own foreign key in the database table, and create a mapping that uses the same converter as defined for the primary key on the enterprise beans at the other end of its relationship.


Related:

  • Troubleshoot and support
  • Assembling EJB modules