The last article in this series discussed the differences between BMP and CMP entity beans. The technical difference is that CMP beans rely on the container for the persistence of a bean's data and is hence easier to develop, whereas BMP beans rely on the bean to persist its own data. We resolved that in some instances, BMP is required, but it is usually a design decision that weighs on the nature of the bean's data as well as its usage.
In this article, we will get down to the details of developing and deploying a BMP entity bean.
BMP Entity Beans
Our goal when writing bean managed beans is to handle the notifications we receive from the EJB container, and perform the desired actions. The container offers the following types of notifications for our data:
When it wants us to create a new data record
When it wants us to delete data
When it wants us to save our data
When it wants us to load our data
When our bean will be passivated
When our passivated bean will be activated