EJBDEPLOY relationships – troubleshooting tips

This article provides troubleshooting information for EJBDEPLOY problems.

DB2 for z/OS Version 7.x [z/OS]

Problems may exist when EJBDeploy creates a data relationship in DB2 for z/OS Version 7.x. EJBDeploy creates a table with a composite of the two primary keys of the EJBs that are related to each other. If the composite keys are larger than 254 characters, DB2 for z/OS V7.x will not accept this relationship and the user will be confronted with errors such as:
DSNT408I SQLCODE = -613, ERROR:  THE PRIMARY KEY OR A UNIQUE CONSTRAINT 
IS TOO LONG OR HAS TOO MANY COLUMNS                                         
DSNT418I SQLSTATE   = 54008 SQLSTATE RETURN CODE              
This problem can be seen when the primary keys that are 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 you do not experience this problem:
  • Top-down mappings are a guideline and must be reviewed with the DBA.
  • Schemas created 'top-down' by EJBDeploy are designed only for testing, and as a guideline for the actual schema required. The use of the 'meet-in-the-middle' mapping does not present this problem.
  • The composite key constraint problem is not experienced when using DB2 V8, which has 2K max key lengths.

EJBDEPLOY_JVM_OPTIONS

Set the EJBDEPLOY_JVM_OPTIONS property to override Java virtual machine (JVM) options that are 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 command increases the heap size of the JVM for ejbdeploy.sh:
export EJBDEPLOY_JVM_OPTIONS="-Xms128m -Xmx512m"

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 , you receive the following message:
No type mapping defined for Java datatype1 to Database datatype2
During run time, the application does not find the CMP bean at the other end of the relationship.

To work around this limitation, define your 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 concepts
welc6toptroubleshooting.html
Related tasks
Assembling EJB modules
Reference topic    

Terms of Use | Feedback

Last updated: Sep 20, 2010 11:08:29 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=vela&product=was-nd-mp&topic=rtrbejbdeploy390
File name: rtrb_ejbdeploy390.html