+

Search Tips   |   Advanced Search

Deploy data access applications


Frequently, deploying data access applications involves more than installing the WAR or EAR file onto a server. Deployment can include tasks for configuring the application to use the data access resources of the server and overall run-time environment.

We can only deploy application code that is assembled into the appropriate modules. The topic Assembling data access applications provides guidelines for this process.

Perform the following steps if the application requires access to a relational database (RDB). If the application requires access to a different type of enterprise information system (EIS), such as an object-oriented database or the Customer Information Control System (CICS), consult the topics Relational resource adapters and JCA and Accessing data using Java EE Connector Architecture connectors.

 

  1. If the RDB configuration does not already exist:

    1. Create a database to hold the data.

    2. Create tables required by the application.

      If the application uses container managed persistence (CMP) entity beans to access the data

      We can create the tables using the data definition language (DDL) generated from the enterprise bean configuration.

      See Recreating database tables from the exported table data definition language.

      If the application uses bean managed persistence (BMP) entity beans, or does not use entity beans

      Use the database server interfaces to create the tables.

      We can also use the EJBs to RDB Mapping wizard of an assembly tool to create the database tables for either type of entity bean. Select the top-down mapping option in the wizard. Keep in mind, however, that this option does not give you direct control in naming the RDB elements or choosing column types. Additionally, because the top-down process is automatic, it might not provide mappings to reflect the precise relationships that you intend.

      If we use Rational Application Developer, consult the information center about the mapping wizard. To learn about all of the assembly tool options, consult the Assembly tools article in this information center.

    3. Check Data source minimum required settings, by vendor to see any database vendor requirements for connecting to an appserver.

  2. If necessary, map the entity beans to the database tables through the meet-in-the-middle mapping option of an assembly tool. This step is necessary only if we did not create the database schema through the top-down mapping option, did not generate the mapping relationships through bottom-up mapping, or did not generate mappings during the application assembly process. For information on the top-down mapping option refer to the information center for Rational Application Developer.

  3. Install the application onto the appserver. Consult Install enterprise application files. When you install the application, we can alter data access settings that were made during application assembly, or set them for the first time if they were omitted from the assembly process. These settings include resource bindings and resource authentication aliases, which are addressed in the following substeps:

    1. Bind application resource references to the data sources, or other resource objects, that provide database connectivity. For details on the concept of binding, see the Data source lookups for enterprise beans and Web modules topic.

      Tip: After deployment, we can use the WAS admin console to alter resource bindings. Click Applications > Application Types > Webphere enterprise apps > application_name, and select the link to the appropriate mapping page. For example, to alter the binding of an EJB module resource, we might click Map data sources for all 2.x CMP beans . For a Web module resource, click Resource references.

    2. Define authentication alias data for resources that must be authenticated with the backend through container-managed authorization.

      In this security configuration, WAS performs EIS signon for data source or connection factory connections. Consult the J2EE connector security topic for detailed reference on resource authentication.

  4. Start the deployed application files using the admin console , the wsadmin startApplication command, or our own Java program.

  5. Save the changes to the admin configuration.

  6. Test the application. For example, point a Web browser at the URL for a deployed application and examine the performance of the application.

 

Results

When you deploy an application that uses a DB2 UDB for IBM i back-end database, we might find the following exception in SystemOut.log:

PMGR6022E: Error using adapter to create or execute an Interaction
This type of error indicates that you deployed an application with Container-managed persistence (CMP) enterprise beans that were originally configured to access a DB2 database on Windows, Linux, or a supported UNIX system. Using the admin console, uninstall the affected CMP applications, then reinstall the applications with the new database setting. Remember to select Deploy enterprise beans; on the EJB deploy panel, select the appropriate version of the DB2 UDB for IBM i database.

 

Next steps

If the application does not perform as desired, update the application, then save and test it again.


Available resources
Map data sources for all 1.x CMP beans
Map default data sources for modules containing 1.x entity beans
Map data sources for all 2.x CMP beans settings
Map data sources for all 2.x CMP beans

 

Related concepts


Data sources
Data source lookups for enterprise beans and Web modules
Relational resource adapters and JCA
The benefits of using resource references

 

Related tasks


Set a resource reference
Install enterprise application files
Assembling applications
Administer data access applications

 

Related


Data source minimum required settings, by vendor
Resource references

 

Related information


Rational Application Developer documentation