O'Reilly logo

Head First EJB by Bert Bates, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Bean/Entity Synchronization: Being an Entity Bean

image with no caption

Entity beans are actors. As long as they’re alive, they’re either in the pool or they’re being somebody. Somebody from the underlying persistent store. In other words, an entity from the database. When a bean is playing a part, the bean and the underlying entity have to stay in sync. Imagine the horror if the bean is pretending to be, say, Audrey Leone, and someone lowers Audrey’s credit limit in the database... but forgets to tell the bean. The bean, acting as Audrey, is happily authorizing purchases for more than Audrey’s current limit. Or what if a client uses the bean to modify Audrey’s address, but the bean hangs on to the new info without telling the database... yikes!

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required