Skip to Content
Java Enterprise in a Nutshell, Second Edition
book

Java Enterprise in a Nutshell, Second Edition

by William Crawford, Jim Farley, David Flanagan
April 2002
Intermediate to advanced
992 pages
40h 18m
English
O'Reilly Media, Inc.
Content preview from Java Enterprise in a Nutshell, Second Edition

Implementing Entity Beans

An entity bean represents data that is stored in a database or some other persistent storage. Entity beans are persistent across client sessions and the lifetime of the server. No matter when or where you get a reference to an entity bean with a given identity, the bean should reflect the current state of the persistent data it represents. Multiple clients can access entity beans with the same identity at the same time. The EJB container manages these concurrent transactions for the underlying entity, ensuring that client transactions are properly isolated from each other, consistent, persistent, etc.

An entity bean can be passivated by its container, but the meaning of being passivated is slightly different than it is with session beans. A container passivates an entity bean (calling its ejbPassivate( ) method in the process) when it wants to disassociate the bean from the persistent data entity it has been representing. After being passivated, the bean may be put into the container’s “wait” pool, to be associated with another client-requested entity at a later time, or it may be removed from the server altogether.

At a fundamental level, entity beans are implemented similarly to session beans. You need to provide a local and/or home interface, a local and/or remote client interface, and a bean implementation. An entity bean, however, requires some additional methods in its home interface and bean implementation, to support the management of its persistent ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Java Enterprise in a Nutshell, Third Edition

Java Enterprise in a Nutshell, Third Edition

Jim Farley, William Crawford
Java Message Service, 2nd Edition

Java Message Service, 2nd Edition

Mark Richards, Richard Monson-Haefel, David A Chappell

Publisher Resources

ISBN: 0596001525Catalog PageErrata