Chapter 9. EJB 1.1 CMP

A Note for EJB 2.0 Readers

Container-managed persistence has undergone a dramatic change in EJB 2.0, which is not backward compatible with EJB 1.1. For that reason, EJB 2.0 vendors must support both EJB 2.0’s container-managed persistence model and EJB 1.1’s container-managed persistence model. The EJB 1.1 model is supported purely for backward compatibility, so that application developers can migrate their existing applications to the new EJB 2.0 platform as painlessly as possible. It’s expected that all new entity beans and new applications will use EJB 2.0 container-managed persistence, not the EJB 1.1 version. Although EJB 1.1 container-managed persistence is covered in this book, avoid it unless you maintain a legacy EJB 1.1 system. EJB 2.0 container-managed persistence is covered in Chapter 6 through Chapter 8.

EJB 1.1 container-managed persistence is limited in several ways. For example, EJB 1.1 CMP beans can have only remote component interfaces; they are not allowed to have local or local home interfaces. Most importantly, EJB 1.1 container-managed entity beans do not support relationships. Other subtle differences also make EJB 1.1 CMP more limiting than EJB 2.0 CMP. For example, the ejbCreate() and ejbPostCreate() methods in EJB 1.1 do not support the < METHOD-NAME > suffix allowed in EJB 2.0, which makes method overloading more difficult. EJB 2.0 CMP is a major improvement over CMP 1.1 and should be used if at all possible.

Get Enterprise JavaBeans, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.