Persistence

Whenever an application is manipulating data, one of its considerations is ensuring longevity of the data beyond the immediate operation. Persistence refers to the activity of ensuring that the changes to data are saved appropriately.

Persistence services are what entity beans are all about, so it is important to understand the differences between the two persistence mechanisms these EJBs can use.

One mechanism is container-managed persistence. The goal for the majority of entity beans you deploy should be to use this mode of operation as frequently as possible. By letting the EJB container manage the persistence, all database access and synchronization is automatically handled for you. Because this is achieved using prebuilt and ...

Get Developing Enterprise Java Applications with J2EE™ and UML 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.