uCosminexus Application Server, Maintenance and Migration Guide

[Contents][Glossary][Index][Back][Next]

Appendix D. Recovering Tables for a CMR When an Error Occurs

This section describes how to recover tables for a CMR that you were using before the occurrence of a failure in a J2EE server, after you deploy an application containing a CMR. For details about the table for CMR, see 9.6.3 Database mapping with CMP2.x in the uCosminexus Application Server Application Setup Guide. When you deploy an application containing CMR, and a failure occurs while you start or terminate a J2EE server in a running state for the purpose of maintenance, the application containing the CMR does not start in the state in which you deployed it. If you resolve the error and make an attempt to deploy the application containing a CMR, you cannot deploy if a table with the same name that you want to create already exists in the database (to prevent sharing of tables between applications).

Here, if you regenerate the SQL, an SQL using new table names for a CMR will be generated, and you can deploy the application to enable the use of tables for a new CMR. If, however, you want to use the same relationship that you were using before terminating the J2EE server, you need to deploy in such a way so as to enable the use of tables remaining in the database.

You can specify the table in ejbserver.ejb.cmp20.cmr.use.existing_table parameter in <configuration> tag of the logical J2EE server (j2ee-server) of the Easy Setup definition file. ejbserver.ejb.cmp20.cmr.use.existing_table is an option to recover the related information used till an error occurred when starting the application. If you specify true, you can deploy such that the existing table in the data base can be used. Use this option to use the existing tables:

  1. Use an SQL to confirm that the tables for CMR that you were using before the failure occurred are remaining in the database.
  2. Terminate the J2EE server (take an action against the cause of failure to start the application in the deployed state).
  3. Specify the following in ejbserver.ejb.cmp20.cmr.use.existing_table parameter in <configuration> tag of the logical J2EE server (j2ee-server) of the Easy Setup definition file.
    <param-name> tag
    ejbserver.ejb.cmp20.cmr.use.existing_table
    <param-value> tag
    true
  4. Start the J2EE server.
  5. Re-deploy the application containing a CMR that failed to start in the deployed state.
    Note
    Here, do not regenerate the SQL. If you regenerate, an SQL with new table names will be generated, and you will not be able to use the previous tables.
  6. Stop the J2EE server.
  7. Whether to specify false in the ejbserver.ejb.cmp20.cmr.use.existing_table parameter in <configuration> tag of the logical J2EE server (j2ee-server) of the Easy Setup definition file or return to the state where this option is not set.
  8. Re-start the J2EE server.