Entity Bean
Encyclopedia
An Entity Bean is a type of Enterprise JavaBean
, a server-side J2EE
component, that represents persistent data maintained in a database
. An entity bean can manage its own persistence (Bean managed persistence) or can delegate this function to its EJB Container (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
(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
only supports 65536 ports 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.
Enterprise JavaBean
Enterprise JavaBeans is a managed, server-side component architecture for modular construction of enterprise applications.The EJB specification is one of several Java APIs in the Java EE specification. EJB is a server-side model that encapsulates the business logic of an application...
, a server-side J2EE
Java Platform, Enterprise Edition
Java Platform, Enterprise Edition or Java EE is widely used platform for server programming in the Java programming language. The Java platform differs from the Java Standard Edition Platform in that it adds libraries which provide functionality to deploy fault-tolerant, distributed, multi-tier...
component, that represents persistent data maintained in a database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...
. An entity bean can manage its own persistence (Bean managed persistence) or can delegate this function to its EJB Container (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
Java Persistence API
The Java Persistence API, sometimes referred to as JPA, is a Java programming language framework managing relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition....
(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
Java remote method invocation
The Java Remote Method Invocation Application Programming Interface , or Java RMI, is a Java application programming interface that performs the object-oriented equivalent of remote procedure calls ....
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
Transmission Control Protocol
The Transmission Control Protocol is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite, complementing the Internet Protocol , and therefore the entire suite is commonly referred to as TCP/IP...
only supports 65536 ports 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.