WebSphere Application Server Network Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Setting the run time for CMP sequence groups

Before you begin

By designating CMP sequence groups for entity beans, you can prevent certain types of database-related exceptions from occurring during the run time of your EJB application. Within each group you specify the order in which the beans update your relational database tables.
When you define a sequence group, you designate it as one of two types:
  • RI_INSERT, for setting a bean persistence sequence to prevent database referential integrity (RI) violations
  • UPDATE_LOCK, for setting a bean persistence sequence to minimize exceptions resulting from optimistic concurrency control

Why and when to perform this task

Both types of sequence groups must be created after you have assembled the beans into an EJB module, prior to installing your application on the product. If you need to edit sequence groups, you must uninstall the application, make your changes using the following steps as a guide, and then reinstall your application.
Note: If you already selected or plan to use top-down mapping for mapping your enterprise beans to back end data, you do not need to create a sequence group with an RI_INSERT type. The product does not generate an RI policy for the database schema that it creates when you select top-down mapping.

Steps for this task

  1. Start the assembly tool.
  2. Open the J2EE perspective. Click Window > Open perspective > J2EE.
  3. In a J2EE hierarchy view (Window > Show view > J2EE hierarchy), right-click the EJB module containing beans that require sequence grouping, and click Open with > EJB deployment descriptor editor. The EJB deployment descriptor editor for the module is displayed in a view.
  4. Click the Overview tab.
  5. In the EJB CMP sequence groups section, click Add. The EJB CMP Sequence Group wizard panel is displayed.
  6. Type a name for your sequence group.
  7. Type your group type designation in all capital letters: RI_INSERT or UPDATE_LOCK
  8. In the Available Beans list, highlight the first bean that you want to place in the group. Click the arrow pointing toward the Selected beans list. The bean name is removed from the Available beans list and is displayed in the Selected beans list.
  9. Repeat the previous step until you complete your sequence group. You must add each bean in the order that you want the persistence manager to handle it. In the case of delete operations for an RI_INSERT group, the persistence manager reverses the order that you designate and deletes the beans and their corresponding database rows accordingly. If you need to alter the sequence of your group, select a bean and click the arrow to move the bean one position vertically.
  10. Save your changes to the deployment descriptor.
    1. Close the EJB deployment descriptor editor.
    2. When prompted, click Yes to indicate that you want to save changes to the deployment descriptor.
    You also can save changes to deployment descriptors at any time by pressing Ctrl+S.

What to do next

You are now ready to deploy your EJB module or combine it with other modules into a J2EE application.



Related concepts
Sequence grouping for container-managed persistence

Related tasks
Deploying and administering applications

Task topic    

Terms of Use | Feedback

Last updated: Mar 17, 2005 4:28:29 AM CST
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tejb_sequencegrp.html

© Copyright IBM Corporation 2003, 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)