An "Entity Bean" is a type of
Enterprise JavaBean
Jakarta Enterprise Beans (EJB; formerly Enterprise JavaBeans) is one of several Java APIs for modular construction of enterprise software. EJB is a server-side software component that encapsulates business logic of an application. An EJB web co ...
, a server-side
Java EE
Jakarta EE, formerly Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE), is a set of specifications, extending Java SE with specifications for enterprise features such as distributed computing and web serv ...
component, that represents persistent data maintained in a
database
In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases sp ...
. An entity bean can manage its own persistence (Bean managed persistence) or can delegate this function to its
EJB Container
Jakarta Enterprise Beans (EJB; formerly Enterprise JavaBeans) is one of several Java APIs for modular construction of enterprise software. EJB is a server-side software component that encapsulates business logic of an application. An EJB web co ...
(Container managed persistence). An entity bean is identified by a primary key. If the container in which an entity bean is hosted crashes, the entity bean, its primary key, and any remote references survive the crash.
In EJB 3.0, entity beans were superseded by the
Java Persistence API
Jakarta Persistence (JPA; formerly Java Persistence API) is a Jakarta EE application programming interface specification that describes the management of relational data in enterprise Java applications.
Persistence in this context covers three a ...
(which was subsequently completely separated to its own spec as of EJB 3.1). Entity Beans have been marked as a candidate for pruning as of Java EE 6
and are therefore considered a
deprecated technology.
Entity Beans before EJB 2.0 should not be used in great numbers
[
] because each entity bean was in fact a
RMI stub with its own RMI connection to the EJB server. Obtaining 1000 entity beans as a single operation would result in 1000 simultaneous internet connections to the RMI back-end . Since
TCP/IP
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the set of communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suit ...
only supports 65536
ports
A port is a maritime facility comprising one or more wharves or loading areas, where ships load and discharge cargo and passengers. Although usually situated on a sea coast or estuary, ports can also be found far inland, such as H ...
you are essentially limited to using 65536 entity beans at a time. For example, if a client application wanted to monitor the state of 1024 database entries it would take 1024 entity bean references and thus 1024 RMI connections to the EJB server, the EJB server would in turn need to support all 1024 connections from each client application, and would be limited to serving at most 64 client applications at which point all further internet connections would be ignored. These limitations are impossible to overcome when using entity beans over RMI.
References
External links
What is an Entity Bean? (Sun's J2EE Tutorial)
Java enterprise platform
{{Compu-lang-stub